Fixed zombi problem

This commit is contained in:
madmaurice 2015-12-03 17:59:58 +01:00
parent cd152f0f6d
commit 2e8a8a8db0

View file

@ -62,7 +62,7 @@ diskspace() {
while true; do while true; do
info=$(df -h / | awk '{if($6 == "/") { print $5 }}') info=$(df -h / | awk '{if($6 == "/") { print $5 }}')
echo diskspace "$icon_diskspace $info" > $FIFO; echo diskspace "$icon_diskspace $info" > $FIFO;
sleep 20; sleep 20;
done; done;
} }
@ -87,7 +87,7 @@ battery() {
if [ "$level" -lt 20 ]; then if [ "$level" -lt 20 ]; then
info="%{F$color_battery_low}$level%%{F-}" info="%{F$color_battery_low}$level%%{F-}"
fi fi
echo battery "$info" > $FIFO echo battery "$info" > $FIFO
sleep 2m; sleep 2m;
@ -100,7 +100,7 @@ batterysymbol() {
[ -n "$(acpi -a | grep on-line)" ] && icon=$icon_battery_charging [ -n "$(acpi -a | grep on-line)" ] && icon=$icon_battery_charging
echo batterysymbol "$icon" > $FIFO echo batterysymbol "$icon" > $FIFO
sleep 5; sleep 5;
done done
} }
@ -114,7 +114,7 @@ clock() {
seconds_to_wait=10 seconds_to_wait=10
fi fi
echo clock "$icon_clock $info" > $FIFO; echo clock "$icon_clock $info" > $FIFO;
sleep $seconds_to_wait sleep $seconds_to_wait
done; done;
} }
@ -157,9 +157,6 @@ updates() {
cd $(dirname $0) cd $(dirname $0)
#Trap magic
trap "trap - SIGTERM && kill -9 -- -$$" SIGINT SIGTERM EXIT
#Fifo #Fifo
[ -e "$FIFO" ] && rm -f $FIFO [ -e "$FIFO" ] && rm -f $FIFO
mkfifo $FIFO mkfifo $FIFO
@ -174,6 +171,12 @@ diskspace &
wifi & wifi &
updates & 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 $!