2022-02-08 13:39:25 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# TODO: Stop all software before logout
|
|
|
|
# https://faq.i3wm.org/question/239/how-do-i-suspendlockscreen-and-logout.1.html#post-id-1927
|
2022-02-09 19:01:39 +01:00
|
|
|
# See: https://faq.i3wm.org/question/5654/how-can-i-disable-notifications-when-the-screen-locks-and-enable-them-again-when-unlocking/index.html#post-id-5655
|
|
|
|
|
|
|
|
# guess i3lock via nix points to other PAM and therefore does not identify by password
|
2022-02-08 13:39:25 +01:00
|
|
|
|
2022-02-08 21:45:11 +01:00
|
|
|
chosen=$(echo -e "lock\nsuspend\nlogout" | dmenu -i)
|
2022-02-08 13:39:25 +01:00
|
|
|
case "$chosen" in
|
|
|
|
"lock")
|
|
|
|
pkill -u "$USER" -USR1 dunst
|
|
|
|
i3lock -c '#2E3436'
|
|
|
|
pkill -u "$USER" -USR2 dunst
|
|
|
|
;;
|
|
|
|
"suspend")
|
2022-02-09 19:01:39 +01:00
|
|
|
pkill -u "$USER" -USR1 dunst
|
2022-02-09 17:07:40 +01:00
|
|
|
i3lock -c '#2E3436'
|
2022-02-08 13:39:25 +01:00
|
|
|
systemctl suspend
|
2022-02-09 19:01:39 +01:00
|
|
|
pkill -u "$USER" -USR2 dunst
|
2022-02-08 13:39:25 +01:00
|
|
|
;;
|
|
|
|
"logout")
|
|
|
|
i3-msg exit
|
|
|
|
;;
|
2022-02-09 19:01:39 +01:00
|
|
|
# Not supported, seems to complicated and not recommended with ssh
|
2022-02-08 13:39:25 +01:00
|
|
|
# "hibernate")
|
2022-02-09 19:01:39 +01:00
|
|
|
# pkill -u "$USER" -USR1 dunst
|
|
|
|
# i3lock -c '#2E3436'
|
|
|
|
# systemctl suspend
|
|
|
|
# pkill -u "$USER" -USR2 dunst
|
2022-02-08 13:39:25 +01:00
|
|
|
# ;;
|
|
|
|
*)
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
esac
|