Dwmbar now prepared to avoid breakage
This commit is contained in:
parent
fb359dfcc5
commit
97ba1afa95
|
@ -3,9 +3,6 @@
|
|||
# This script sets the statusbar with the xsetroot command at the end. Have it
|
||||
# started by ~/.xinitrc or ~/.xprofile.
|
||||
|
||||
# Handle SIGTRAP signals sent by refbar to update the status bar immediately.
|
||||
trap 'update' 5
|
||||
|
||||
# Set the deliminter character.
|
||||
delim="|"
|
||||
|
||||
|
@ -182,20 +179,24 @@ update() { \
|
|||
# everything in dwm. Note entirely sure of the cause, but again, the tr
|
||||
# command easily avoids it.
|
||||
xsetroot -name "$(status | tr '\n' ' ')" &
|
||||
wait
|
||||
# wait
|
||||
|
||||
# Check to see if new weather report is needed.
|
||||
# testweather &
|
||||
wait
|
||||
# wait
|
||||
}
|
||||
|
||||
# Handle SIGTRAP signals sent by refbar to update the status bar immediately.
|
||||
trap update TRAP
|
||||
|
||||
lockfile="/tmp/dwmbar-lock"
|
||||
update
|
||||
while :; do
|
||||
update
|
||||
# Sleep for a minute after changing the status bar before updating it
|
||||
# again. We run sleep in the background and use wait until it finishes,
|
||||
# because traps can interrupt wait immediately, but they can't do that
|
||||
# with sleep.
|
||||
touch "$lockfile" 2>/dev/null
|
||||
sleep 69d &
|
||||
wait
|
||||
done
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
lockfile="/tmp/dwmbar-lock"
|
||||
p_num=$(pgrep -a busybox | grep "busybox .*/dwmbar.sh" | cut -d ' ' -f 1)
|
||||
# echo "$p_num"
|
||||
[ -n "$p_num" ] && kill -s 5 "$p_num"
|
||||
[ -n "$p_num" ] && rm "$lockfile" 2>/dev/null && kill -s 5 "$p_num"
|
||||
|
|
Loading…
Reference in New Issue