3 ##################################
4 ## status monitor for instantWM ##
5 ##################################
10 # append item with brackets
15 # update different parts with different frequency
19 if ping -q -c 1 -W 1 8.8.8.8; then
22 INTERNET="^c#ff0000^X^d^"
25 # battery indicator on laptop
26 if [ -n "$ISLAPTOP" ]; then
28 if [[ $TMPBAT =~ "Charging" ]]; then
29 BATTERY="^c#00ff00^B"$(egrep -o '[0-9]*%' <<<"$TMPBAT")"^d^"
31 BATTERY="B"$(egrep -o '[0-9]*%' <<<"$TMPBAT")
32 # make indicator red on low battery
33 if [ $(grep '[0-9]*' <<<$BATTERY) -lt 10 ]; then
34 BATTERY="^c#ff0000^$BATTERY^d^"
40 # needed only for shorttime cache, remove in case it changes
41 [ -e /tmp/instantos/pasink ] && rm /tmp/instantos/pasink
47 # check for pacman updates
48 if [ "$INTERNET" = "i" ]; then
49 if UPDATES=$(checkupdates); then
50 echo "$UPDATES updates found"
51 UPDATES=$(wc -l <<<"$UPDATES")
53 echo "system is up to date"
64 # option to disable status text and check for enabling it again
65 if [ -e ~/.instantsilent ]; then
71 addstatus "$(date +'%d-%m|%H:%M')"
73 addstatus "A$(amixer get Master | egrep -o '[0-9]{1,3}%' | head -1)"
76 [ -n "$ISLAPTOP" ] && addstatus "B$BATTERY"
78 [ -n "$UPDATES" ] && addstatus "U$UPDATES"
80 xsetroot -name "^f11^$date"