mirror of
https://github.com/Keyitdev/dotfiles.git
synced 2026-09-24 01:52:09 +00:00
54 lines
857 B
Bash
Executable File
54 lines
857 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# rofi theme
|
|
theme="$HOME/.config/rofi/main_without_icons.rasi"
|
|
|
|
get_options() {
|
|
echo " Poweroff"
|
|
echo " Reboot"
|
|
echo " Reboot to Windows"
|
|
echo " Hibernate"
|
|
echo " Lock"
|
|
echo " Suspend"
|
|
echo " Log out"
|
|
}
|
|
|
|
main() {
|
|
|
|
# get choice from rofi
|
|
# choice=$( (get_options) | rofi -dmenu -i -fuzzy -p "" -theme "$theme")
|
|
choice=$( (get_options) | rofi -dmenu -i -fuzzy -p "")
|
|
|
|
# run the selected command
|
|
case $choice in
|
|
' Poweroff')
|
|
systemctl poweroff
|
|
;;
|
|
' Reboot')
|
|
systemctl reboot
|
|
;;
|
|
' Reboot to Windows')
|
|
pkexec grub-reboot 3 && systemctl reboot
|
|
;;
|
|
' Hibernate')
|
|
systemctl hibernate
|
|
;;
|
|
' Lock')
|
|
lock
|
|
;;
|
|
' Suspend')
|
|
systemctl suspend
|
|
;;
|
|
' Log out')
|
|
i3-msg exit
|
|
;;
|
|
|
|
esac
|
|
|
|
# done
|
|
set -e
|
|
}
|
|
|
|
main &
|
|
|
|
exit 0 |