diff options
author | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2024-10-30 17:38:56 +0300 |
---|---|---|
committer | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2024-10-30 17:38:56 +0300 |
commit | b490fe4bea23a89d85509403c9e5a86f2c16173e (patch) | |
tree | c63deb4401da98ba717fa17e7eb013f7edc4bb56 /dotfiles/.local/bin/swaysession | |
parent | b21dc7fcd29a0bb5239c5fb07e8cf08720f3b5e2 (diff) | |
download | swayrice-b490fe4bea23a89d85509403c9e5a86f2c16173e.tar.gz swayrice-b490fe4bea23a89d85509403c9e5a86f2c16173e.zip |
trying out niri
Diffstat (limited to 'dotfiles/.local/bin/swaysession')
-rwxr-xr-x | dotfiles/.local/bin/swaysession | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/dotfiles/.local/bin/swaysession b/dotfiles/.local/bin/swaysession index 0beaa1c..218ff43 100755 --- a/dotfiles/.local/bin/swaysession +++ b/dotfiles/.local/bin/swaysession @@ -2,13 +2,21 @@ [ "$(cat /proc/1/comm)" = "systemd" ] && logind=systemctl || logind=loginctl +exit_session() { + if [ -n "$SWAYSOCK" ]; then + swaymsg exit + else + niri msg quit + fi +} + case "$1" in lock) lock-color ;; logout) canberra-gtk-play -i Oxygen-Sys-Log-Out & sleep 1.2 - swaymsg exit + exit_session clear if [ ! -e ~/.cache/dont-kill ]; then killall -u $(whoami) @@ -26,13 +34,13 @@ case "$1" in reboot) canberra-gtk-play -i Oxygen-Sys-Log-Out & sleep 1.2 clear - swaymsg exit + exit_session sudo reboot now ;; poweroff) canberra-gtk-play -i Oxygen-Sys-Log-Out & sleep 1.2 clear - swaymsg exit + exit_session # Having problems with logind poweroff and reboot after sway exit sudo poweroff now ;; |