.dotfiles/.bin/menu-shutdown

27 lines
540 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() {
2024-10-04 22:42:21 +00:00
alacritty -e sh -c "autorestic backup -av && sleep 3"
2023-12-14 16:53:28 +00:00
}
if [ -z "$action" ]; then
exit 1
fi
2020-09-23 09:25:17 +00:00
case "$action" in
2024-03-08 17:31:33 +00:00
"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