diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-08-22 22:03:13 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-08-22 22:03:13 +0200 |
commit | 57650e96e2c3a24d2101b5497c255f21b52d2f92 (patch) | |
tree | 588b738336bab588218f9e9db5eae1d9ce5b1bb1 /bin | |
parent | f2bcbc845adcd02b1b12fa00f1b8c08782ff929c (diff) |
[mpower] small refactor and added commander
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/menuscripts/mpower | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/bin/menuscripts/mpower b/bin/menuscripts/mpower index 443ed54..005c497 100755 --- a/bin/menuscripts/mpower +++ b/bin/menuscripts/mpower @@ -1,14 +1,7 @@ #!/bin/sh -if [ "$MENUCMD" = "tofi" ] -then - menucmd="tofi --width 10% --height 13% --padding-left 2%" -elif [ "$MENUCMD" = "dmenu" ] -then - menucmd="dmenu -g 2 -l 2" -else - menucmd="fzf" -fi +choice="$(printf 'poweroff +suspend +hibernate +reboot' | commander -c -d)" -choices="poweroff\nreboot\nhibernate\nsuspend" -choice="$(printf "$choices" | $menucmd)" -test -z "$choice" || systemctl "$choice" +[ "$choice" ] && systemctl "$choice" |