summaryrefslogtreecommitdiff
path: root/bin/wrappers/dwm_watch_binary
diff options
context:
space:
mode:
authorA Farzat <a@farzat.xyz>2024-10-24 23:31:41 +0900
committerA Farzat <a@farzat.xyz>2024-11-04 23:31:41 +0900
commit7e905e33bc55d142b4fd32c28cc2be99dfdd3f0b (patch)
tree2c838df08dfb827ae4d554c576e5052ad0326fa6 /bin/wrappers/dwm_watch_binary
parentd8ae1706a62b23b6071d8f46ace9523fbbb1adac (diff)
downloaddotfiles-7e905e33bc55d142b4fd32c28cc2be99dfdd3f0b.tar.gz
dotfiles-7e905e33bc55d142b4fd32c28cc2be99dfdd3f0b.zip
Add useful wrapper scripts
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