URI: 
       dwm-5.2-colorstatus.xinitrc - sites - public wiki contents of suckless.org
  HTML git clone git://git.suckless.org/sites
   DIR Log
   DIR Files
   DIR Refs
       ---
       dwm-5.2-colorstatus.xinitrc (784B)
       ---
            1 while true
            2 do
            3         datestr=`date '+%a, %x'`
            4         timestr=`date '+%H:%M'`
            5         
            6         cpuavgload=`uptime | sed -n 's/.*: //; s/, .*// p'`
            7 
            8         batcurrent=`sed -n 's/ mAh//; s/remaining[ a-z:]*// p' /proc/acpi/battery/BAT1/state`
            9         batfull=`sed -n 's/ mAh//; s/last full[ a-z:]*// p' /proc/acpi/battery/BAT1/info`
           10         batpercent=`echo "($batcurrent*100)/$batfull" | bc`
           11         if [ $batpercent -lt 10 ]
           12                 then batpercent=`echo [c]$batpercent%[c]`
           13                 else batpercent=`echo $batpercent%`
           14         fi
           15         
           16         audiofront=`amixer sget Front | sed -n 's/\] \[[^%]*\]//; s/[ ]*Front Left: Playback [0-9]* \[// p'`
           17 
           18         mailnew=`claws-mail --status inbox | sed -n 's/ [ 0-9ClawsMinotrug\.]*// p'`
           19 
           20         echo -e NEW mail: $mailnew \| VOL front: $audiofront \| BAT:[i]$batpercent[i]\| CPU: $cpuavgload \| $datestr[c]$timestr
           21 
           22         sleep 2
           23 done | dwm
           24