diff --git a/bspwm/.config/scripts/bar.sh b/bspwm/.config/scripts/bar.sh index c777f4a..e5200b1 100755 --- a/bspwm/.config/scripts/bar.sh +++ b/bspwm/.config/scripts/bar.sh @@ -62,7 +62,7 @@ diskspace() { while true; do info=$(df -h / | awk '{if($6 == "/") { print $5 }}') echo diskspace "$icon_diskspace $info" > $FIFO; - + sleep 20; done; } @@ -87,7 +87,7 @@ battery() { if [ "$level" -lt 20 ]; then info="%{F$color_battery_low}$level%%{F-}" fi - + echo battery "$info" > $FIFO sleep 2m; @@ -100,7 +100,7 @@ batterysymbol() { [ -n "$(acpi -a | grep on-line)" ] && icon=$icon_battery_charging echo batterysymbol "$icon" > $FIFO - + sleep 5; done } @@ -114,7 +114,7 @@ clock() { seconds_to_wait=10 fi echo clock "$icon_clock $info" > $FIFO; - + sleep $seconds_to_wait done; } @@ -157,9 +157,6 @@ updates() { cd $(dirname $0) -#Trap magic -trap "trap - SIGTERM && kill -9 -- -$$" SIGINT SIGTERM EXIT - #Fifo [ -e "$FIFO" ] && rm -f $FIFO mkfifo $FIFO @@ -174,6 +171,12 @@ diskspace & wifi & updates & -( while true; do cat $FIFO; done ) | python ./barformatter.py "$FORMAT" | lemonbar -g 1366x18 -f "Stlarch:size=6:style=regular" -f "Inconsolata:size=8" -B "#88000000" +#Trap magic +trap "kill -9 -$$" TERM INT +echo Trap set for $$ -exit 0 +( +( while [ -e "$FIFO" ]; do cat $FIFO; done ) | python ./barformatter.py "$FORMAT" | lemonbar -g 1366x18 -f "Stlarch:size=6:style=regular" -f "Inconsolata:size=8" -B "#88000000" +) & + +wait $!