Update: added powermenu, minor bug fixes

This commit is contained in:
Keyitdev
2022-07-24 20:10:29 +02:00
parent a2d46e7b94
commit c3f992e4d6
7 changed files with 60 additions and 11 deletions
+48
View File
@@ -0,0 +1,48 @@
#!/bin/sh
# rofi theme
theme="$HOME/.config/rofi/main_without_icons.rasi"
get_options() {
echo " Poweroff"
echo " Reboot"
echo " Hibernate"
echo " Lock"
echo " Suspend"
echo " Log out"
}
main() {
# get choice from rofi
choice=$( (get_options) | rofi -dmenu -i -fuzzy -p "" -theme "$theme")
# run the selected command
case $choice in
' Poweroff')
systemctl poweroff
;;
' Reboot')
systemctl reboot
;;
' Hibernate')
systemctl hibernate
;;
' Lock')
lock
;;
' Suspend')
systemctl suspend
;;
' Log out')
i3-msg exit
;;
esac
# done
set -e
}
main &
exit 0