3 ##################################
4 ## status monitor for instantWM ##
5 ##################################
16 echo "$2" >/tmp/instantos/status/"$1"
20 mkdir -p /tmp/instantos/status
22 # update different parts with different frequency
26 if ping -q -c 1 -W 1 8.8.8.8; then
27 INTERNET="^c$GREEN^ i ^d^"
29 INTERNET="^c$RED^ i ^d^"
32 istat INTERNET "$INTERNET"
34 # battery indicator on laptop
35 if [ -n "$ISLAPTOP" ]; then
37 if [[ $TMPBAT =~ "Charging" ]]; then
38 BATTERY="^c$GREEN^ B"$(egrep -o '[0-9]*%' <<<"$TMPBAT")" "
40 BATTERY=" B"$(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^ B$BATTERY ^d^"
46 istat BATTERY "$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 ] && [ -z "$FORCESTATUS" ]; then
80 for i in /tmp/instantos/status/*; do
81 date="${date}$(cat $i)"
85 date="$date^d^ $(date +'%d-%m') ^c$DARKBACK^ $(date +'%H:%M') "
87 date="$date^c$LIGHTBACK^ A$(amixer get Master | grep -Eo '[0-9]{1,3}%' | head -1) "
90 xsetroot -name "^d^^f11^$date^d^"