From 82b789920b192634e5144ae59fe94cb7c415b3f9 Mon Sep 17 00:00:00 2001 From: tiyn Date: Fri, 3 Nov 2023 17:11:46 +0100 Subject: [PATCH] xorg: restart dwm on changes otherwise logout --- .xinitrc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.xinitrc b/.xinitrc index 17a2829..8f9dda6 100644 --- a/.xinitrc +++ b/.xinitrc @@ -9,6 +9,17 @@ xrandr --auto setbg -while true; do - dwm || exit +csum="" +new_csum=$(sha1sum $(which dwm)) +while true +do + if [ "$csum" != "$new_csum" ] + then + csum=$new_csum + dwm + else + exit 0 + fi + new_csum=$(sha1sum $(which dwm)) + sleep 0.5 done