Made scripts more readable by moving most logic to functions.

This commit is contained in:
cronyakatsuki 2022-11-04 14:54:08 +01:00
parent 86e3a3a79c
commit 5c738fdc77
11 changed files with 234 additions and 133 deletions

View file

@ -2,9 +2,21 @@
# simple power menu script
. $HOME/.config/dmenu/config
load_config () {
. $HOME/.config/dmenu/config
}
case "$(printf "shutdown\\nreboot" | $DMENU -p "Choose your poison")" in
"shutdown") poweroff ;;
"reboot") reboot ;;
esac
menu () {
case "$(printf "shutdown\\nreboot" | $DMENU -p "Choose your poison")" in
"shutdown") poweroff ;;
"reboot") reboot ;;
esac
}
main () {
load_config
menu
}
main $@