Add logout window on power menu click

This commit is contained in:
2021-09-23 19:57:03 +03:00
parent 2551f11e29
commit b142c0fad8
2 changed files with 37 additions and 26 deletions

22
polybar/logout-window.sh Executable file
View File

@@ -0,0 +1,22 @@
#! /bin/bash
action=$(yad --width 300 --entry --title "System Logout" \
--button="Ok" --button="Cancel" \
--text "What to do?" \
--entry-text \
"Power Off" "Reboot" "Logout" \
)
return=$?
if [[ $return -eq 1 ]] ; then
exit 0
fi
case $action in
Power*) cmd="systemctl poweroff" ;;
Reboot*) cmd="systemctl reboot" ;;
Logout*) cmd="i3-msg exit"
esac
eval exec $cmd