add dmenu script for power state management under a single command

This commit is contained in:
Diego Leal 2019-05-27 21:15:25 +01:00
parent 6f4c012edb
commit 98575fbe62
2 changed files with 14 additions and 3 deletions

View File

@ -36,9 +36,7 @@ super + Scroll_Lock
super + Insert
showclip
super + shift + x
prompt "Shutdown computer?" "sudo -A shutdown -h now"
super + shift + BackSpace
prompt "Reboot computer?" "sudo -A shutdown -r now"
dmenulogout
super + x
mpc pause; pauseallmpv; i3lock -e -f -c 1d2021; xset dpms force off
XF86Launch1

13
.local/bin/i3cmds/dmenulogout Executable file
View File

@ -0,0 +1,13 @@
#!/bin/sh
MESSAGE="lock\\nexit\\nsuspend\\nhibernate\\nreboot\\nshutdown"
ACTION="$(printf "$MESSAGE" | dmenu -l 6 -i -p "Do what now?")"
case "$ACTION" in
"lock") i3lock -n -c 222222 ;;
"exit") i3-msg exit ;;
"suspend") systemctl suspend ;;
"hibernate") systemctl hibernate ;;
"reboot") systemctl reboot ;;
"shutdown") systemctl poweroff -i ;;
esac