summaryrefslogtreecommitdiff
path: root/bin/wrappers/dwm_watch_binary
blob: ebe34f0875888e6a248e0f636ee006ff0097f1aa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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