diff --git a/.config/X11/xinitrc b/.config/X11/xinitrc index 6408771e..5cc4a14b 100755 --- a/.config/X11/xinitrc +++ b/.config/X11/xinitrc @@ -14,7 +14,5 @@ echo "Starting DWM" dwm -echo "Exited DWM, Killing $(jobs -p | awk "{print \$3}")" - -kill $(jobs -p | awk "{print \$3}") +echo "Exited DWM" ' diff --git a/.local/libexec/dwm/autostart.sh b/.local/libexec/dwm/autostart.sh index ed5e35d2..50daceba 100755 --- a/.local/libexec/dwm/autostart.sh +++ b/.local/libexec/dwm/autostart.sh @@ -1,6 +1,9 @@ #!/bin/sh # This script is executed by DWM on start. +SIGINT=2 SIGTERM=15 +trap 'trap - SIGTERM && kill -- -$$' $SIGINT $SIGTERM EXIT + start() { pidof -sx "$1" || "$@" & } @@ -32,9 +35,10 @@ remaps -qd start unclutter -noevents & start gpgconf --launch gpg-agent -start env PATH="$HOME/.local/libexec/statusbar:$PATH" dwmblocks start picom start pipewire start dunst start checkup start syncthingtray + +killall dwmblocks; env PATH="$HOME/.local/libexec/statusbar:$PATH" dwmblocks &