add script to start dwm to allow for restarts
This commit is contained in:
parent
1f56cc2dc4
commit
62a3264a54
3 changed files with 25 additions and 1 deletions
6
README.md
Normal file
6
README.md
Normal 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
18
start_dwm
Executable 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
|
||||||
|
|
||||||
2
xinitrc
2
xinitrc
|
|
@ -64,4 +64,4 @@ case "$_host" in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
exec ~/.bin/start_dwm
|
exec /usr/local/bin/start_dwm
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue