Made scripts more readable by moving most logic to functions.
This commit is contained in:
parent
86e3a3a79c
commit
5c738fdc77
11 changed files with 234 additions and 133 deletions
|
@ -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 $@
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue