3 ##################################
4 ## status monitor for instantWM ##
5 ##################################
14 echo "$2" >/tmp/instantos/status/"$1"
21 mkdir -p /tmp/instantos/status
23 # update different parts with different frequency
27 if ping -q -c 1 -W 1 8.8.8.8; then
28 INTERNET="^c$GREEN^i^d^"
30 INTERNET="^c$RED^X^d^"
32 istat INTERNET "$INTERNET"
34 # battery indicator on laptop
35 if [ -n "$ISLAPTOP" ]; then
37 if [[ $TMPBAT =~ "Charging" ]]; then
38 BATTERY="^c$GREEN^"$(egrep -o '[0-9]*%' <<<"$TMPBAT")"^d^"
40 BATTERY=$(egrep -o '[0-9]*%' <<<"$TMPBAT")
41 # make indicator red on low battery
42 if [ $(grep '[0-9]*' <<<$BATTERY) -lt 10 ]; then
43 BATTERY="^c$RED^$BATTERY^d^"
46 istat BATTERY "B$BATTERY"
50 # needed only for shorttime cache, remove in case it changes
51 [ -e /tmp/instantos/pasink ] && rm /tmp/instantos/pasink
57 # check for pacman updates
58 if [ "$INTERNET" = "i" ]; then
59 if UPDATES=$(checkupdates); then
60 echo "$UPDATES updates found"
61 UPDATES=$(wc -l <<<"$UPDATES")
63 echo "system is up to date"
66 istat UPDATES "U$UPDATES"
74 # option to disable status text and check for enabling it again
75 if [ -e ~/.instantsilent ]; then
80 for i in /tmp/instantos/status/*; do
81 date="${date} [$(cat $i)]"
85 addstatus "$(date +'%d-%m|%H:%M')"
87 addstatus "A$(amixer get Master | egrep -o '[0-9]{1,3}%' | head -1)"
90 xsetroot -name "^f11^$date"