simple-power-menu: run lockscreen before suspending

This commit is contained in:
Guilherme Rugai Freire 2021-10-31 17:40:03 -03:00
parent 770c8a540f
commit 18f3261665
No known key found for this signature in database
GPG Key ID: 0F9FE41723A8A297

View File

@ -9,7 +9,7 @@ else
exit 1; exit 1;
fi fi
fn_logout() { _fn_logout() {
case "$DESKTOP_SESSION" in case "$DESKTOP_SESSION" in
*openbox*) openbox --exit;; *openbox*) openbox --exit;;
*i3*) i3-msg exit;; *i3*) i3-msg exit;;
@ -20,12 +20,21 @@ fn_logout() {
esac esac
} }
_lockscreen() {
betterlockscreen -l dimblur
}
_suspend() {
_lockscreen &
systemctl suspend
}
OPTIONS="\ OPTIONS="\
Shutdown \tsystemctl poweroff Shutdown \tsystemctl poweroff
Reboot \tsystemctl reboot Reboot \tsystemctl reboot
Suspend \tsystemctl suspend Suspend \t_suspend
Lockscreen \tbetterlockscreen -l dimblur Lockscreen \t_lockscreen
Log out \tfn_logout" Log out \t_fn_logout"
PROMPT="$(echo "$OPTIONS" | awk -F"\t" '{print $1}')" PROMPT="$(echo "$OPTIONS" | awk -F"\t" '{print $1}')"