mirror of
https://github.com/olexsmir/dotfiles.git
synced 2026-01-15 16:51:34 +02:00
🎨 Update
This commit is contained in:
parent
07805d44aa
commit
0d2b7d6ba3
28 changed files with 668 additions and 225 deletions
45
script/dmenu/dmenu-power.sh
Executable file
45
script/dmenu/dmenu-power.sh
Executable file
|
|
@ -0,0 +1,45 @@
|
|||
#!/bin/sh
|
||||
|
||||
declare options=("Shut Down
|
||||
Reboot
|
||||
Logout
|
||||
Suspend
|
||||
Lock Screen")
|
||||
|
||||
choice=$(echo -e "${options[@]}" | dmenu -h 24 -p 'Power')
|
||||
|
||||
case "$choice" in
|
||||
"Shut Down")
|
||||
declare opt=("Yes\nNo")
|
||||
yesno=$(echo -e "${opt[@]}" | dmenu -h 24 -p 'Power')
|
||||
case "$yesno" in
|
||||
"Yes") exec systemctl poweroff ;;
|
||||
"No") exec exit 0 ;;
|
||||
esac
|
||||
;;
|
||||
"Reboot")
|
||||
declare opt=("Yes\nNo")
|
||||
yesno=$(echo -e "${opt[@]}" | dmenu -h 24 -p 'Power')
|
||||
case "$yesno" in
|
||||
"Yes") exec systemctl reboot ;;
|
||||
"No") exec exit 0 ;;
|
||||
esac
|
||||
;;
|
||||
"Logout")
|
||||
declare opt=("Yes\nNo")
|
||||
yesno=$(echo -e "${opt[@]}" | dmenu -h 24 -p 'Power')
|
||||
case "$yesno" in
|
||||
"Yes") exec loginctl terminate-session $XDG_SESSION_ID ;;
|
||||
"No") exec exit 0 ;;
|
||||
esac
|
||||
;;
|
||||
"Lock Screen")
|
||||
declare opt=("Yes\nNo")
|
||||
yesno=$(echo -e "${opt[@]}" | dmenu -h 24 -p 'Power')
|
||||
case "$yesno" in
|
||||
"Yes") exec loginctl lock-session $XDG_SESSION_ID ;;
|
||||
"No") exec exit 0 ;;
|
||||
esac
|
||||
;;
|
||||
*) exit 1 ;;
|
||||
esac
|
||||
Loading…
Add table
Add a link
Reference in a new issue