add script to start dwm to allow for restarts

This commit is contained in:
Ray Elliott 2020-02-24 10:33:55 +00:00
parent 1f56cc2dc4
commit 62a3264a54
3 changed files with 25 additions and 1 deletions

6
README.md Normal file
View File

@ -0,0 +1,6 @@
## Notes
```sh
mv /usr/local/bin
sudo ln -s /home/ray/.config/xinitrc/start_dwm
```

18
start_dwm Executable file
View File

@ -0,0 +1,18 @@
#!/bin/sh
# relaunch DWM if the binary changes, otherwise bail
csum=$(sha1sum $(which dwm))
new_csum=""
while true
do
if [ "$csum" != "$new_csum" ]
then
csum=$new_csum
dwm
else
exit 0
fi
new_csum=$(sha1sum $(which dwm))
sleep 1
done

View File

@ -64,4 +64,4 @@ case "$_host" in
;; ;;
esac esac
exec ~/.bin/start_dwm exec /usr/local/bin/start_dwm