dmenu-scripts/dmenu-power-menu

23 lines
284 B
Plaintext
Raw Normal View History

2022-04-05 16:59:13 +02:00
#!/bin/sh
# simple power menu script
2023-11-04 22:03:43 +01:00
load_config() {
. $HOME/.config/dmenu/config
}
2022-07-17 11:03:13 +02:00
2023-11-04 22:03:43 +01:00
menu() {
case "$(printf "shutdown\\nreboot" | $DMENU -p "Choose your poison")" in
"shutdown") loginctl poweroff ;;
"reboot") loginctl reboot ;;
esac
}
2023-11-04 22:03:43 +01:00
main() {
load_config
2023-11-04 22:03:43 +01:00
menu
}
main $@