#!/bin/sh -eu ACTION=$(yad --width=90 \ --height=210 --list --radiolist --text="Select Action" \ --title="Logout" --column "Choice" --column "Action" \ FALSE Shutdown FALSE Reboot TRUE Suspend FALSE Lock FALSE Blank) if [ -n "${ACTION}" ]; then case $ACTION in 'TRUE|Shutdown|') yad --question --text "Are you sure you want to halt?" && sudo -A 'systemctl poweroff' ;; 'TRUE|Reboot|') yad --question --text "Are you sure you want to reboot?" && sudo -A 'systemctl reboot' ;; 'TRUE|Suspend|') systemctl suspend ;; 'TRUE|Lock|') i3lock-fancy ;; 'TRUE|Blank|') sleep 1; xset dpms force off ;; esac fi