.dotfiles/.bin/menu-shutdown

29 lines
525 B
Plaintext
Raw Normal View History

2021-05-13 12:26:52 +00:00
#!/bin/sh
2020-09-23 09:25:17 +00:00
actions="backup-shutdown
2023-12-14 16:53:28 +00:00
shutdown
reboot
soft-reboot
2023-12-14 16:53:28 +00:00
logout
autostart"
action=$(echo "$actions" | $DMENU)
_menu_shutdown_backup() {
alacritty -e "host-backup"
}
if [ -z "$action" ]; then
exit 1
fi
notify-send "$(user-cleaner)"
2020-09-23 09:25:17 +00:00
case "$action" in
backup-shutdown) _menu_shutdown_backup && systemctl poweroff -i ;;
shutdown) systemctl poweroff -i ;;
reboot) systemctl reboot ;;
soft-reboot) systemctl soft-reboot ;;
logout) systemctl --user exit ;;
autostart) autostart-manage run ;;
*) ;; esac