From 7e905e33bc55d142b4fd32c28cc2be99dfdd3f0b Mon Sep 17 00:00:00 2001 From: A Farzat Date: Thu, 24 Oct 2024 23:31:41 +0900 Subject: Add useful wrapper scripts --- bin/wrappers/dwm_watch_binary | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 bin/wrappers/dwm_watch_binary (limited to 'bin/wrappers/dwm_watch_binary') 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 -- cgit v1.2.3-70-g09d2