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