summaryrefslogtreecommitdiff
path: root/bin/wrappers/dwm_watch_binary
diff options
context:
space:
mode:
Diffstat (limited to 'bin/wrappers/dwm_watch_binary')
-rwxr-xr-xbin/wrappers/dwm_watch_binary17
1 files changed, 17 insertions, 0 deletions
diff --git a/bin/wrappers/dwm_watch_binary b/bin/wrappers/dwm_watch_binary
new file mode 100755
index 0000000..ebe34f0
--- /dev/null
+++ b/bin/wrappers/dwm_watch_binary
@@ -0,0 +1,17 @@
+#!/usr/bin/env sh
+
+# relaunch DWM if the binary changes, otherwise bail
+csum=""
+new_csum="$(sha1sum "$(which dwm)")"
+while true
+do
+ if [ "$csum" != "$new_csum" ]
+ then
+ csum=$new_csum
+ dwm
+ else
+ exit
+ fi
+ new_csum="$(sha1sum "$(which dwm)")"
+ sleep 5
+done