diff options
author | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2023-01-13 22:45:35 +0300 |
---|---|---|
committer | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2023-01-13 22:45:44 +0300 |
commit | ef398f6e8860a984d7ea77f2aa71961ed9adb21a (patch) | |
tree | 1cb2f57e1ca25688cf4820baf962fd720f34fa74 /dotfiles | |
parent | eab3ad3a252656d57639ce94867b2a7c3f80bde2 (diff) | |
download | swayrice-ef398f6e8860a984d7ea77f2aa71961ed9adb21a.tar.gz swayrice-ef398f6e8860a984d7ea77f2aa71961ed9adb21a.zip |
Move cleanup from .profile to session script
Move cleanup after exiting sway to swaysession script.
Should find a better way to handle "runaway" programs after logout from
sway.
Diffstat (limited to 'dotfiles')
-rwxr-xr-x | dotfiles/.local/bin/swaysession | 10 | ||||
-rw-r--r-- | dotfiles/.profile | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/dotfiles/.local/bin/swaysession b/dotfiles/.local/bin/swaysession index 2234c11..221ba0e 100755 --- a/dotfiles/.local/bin/swaysession +++ b/dotfiles/.local/bin/swaysession @@ -8,6 +8,10 @@ case "$1" in ;; logout) swaymsg exit + clear + if [ ! -e ~/.cache/dont-kill ]; then + killall -u $(whoami) + fi ;; switch_user) dm-tool switch-to-greeter @@ -19,11 +23,13 @@ case "$1" in lock-color & sleep 1 && $logind hibernate ;; reboot) - rm -f ~/.cache/openvpnpid + swaymsg exit + clear $logind reboot ;; poweroff) - rm -f ~/.cache/openvpnpid + swaymsg exit + clear $logind poweroff ;; *) diff --git a/dotfiles/.profile b/dotfiles/.profile index 00fed07..f3ff763 100644 --- a/dotfiles/.profile +++ b/dotfiles/.profile @@ -44,12 +44,6 @@ eval "$(dircolors "$HOME/.config/dir_colors")" # Start sway automatically upon login on tty1 or tty2 if [ -z $DISPLAY ] && [ $(tty) = /dev/tty1 ] || [ $(tty) = /dev/tty2 ]; then - dbus-run-session sway - if [ $? = 0 ] && [ ! -e ~/.cache/dont-kill ]; then - killall -u $(whoami) - clear - exit - fi - mv ~/.cache/sway.log ~/.cache/sway-crash-$(date +"%Y-%m-%dT%H:%M").log + exec dbus-run-session sway 2> ~/.cache/sway.log fi |