dotfiles

Configuration for the software I use.
git clone https://git.jaderune.net/jbauer/dotfiles
Log | Files | Refs | README | LICENSE

bar-action (1015B)


      1 #!/bin/sh
      2 
      3 while :; do
      4 	vmstats=$(vmstat -c2 | tail -1)
      5 	cpu="$(echo $vmstats | awk '{print 100-$NF}')"%
      6 	mem=$(echo $vmstats | awk '{print $3}')
      7 	dsk=$(df -h /home | tail -1 | awk '{print $5}')
      8 
      9 	bat="$(apm -l)"
     10 	if [ $bat -gt 90 ]; then
     11 		baticon=""
     12 	elif [ $bat -gt 60 ]; then
     13 		baticon=""
     14 	elif [ $bat -gt 30 ]; then
     15 		baticon=""
     16 	elif [ $bat -gt 10 ]; then
     17 		baticon=""
     18 	else
     19 		baticon=""
     20 	fi
     21 	if [ "$(apm -b)" = "3" ]; then
     22 		bat="$bat%+"
     23 	else
     24 		bat="$bat%"
     25 	fi
     26 
     27 	if [ "$(ifconfig iwm0 | grep status | awk '{print $2}')" = "active" ]; then
     28 		net="直"
     29 	else
     30 		net="睊"
     31 	fi
     32 	net_strength=$(ifconfig iwm0 | grep chan | awk '{print $8}')
     33 	if [ -z "$net_strength" ]; then
     34 		net_strength="00%"
     35 	fi
     36 
     37 	if [ "$(sndioctl output.mute | cut -d'=' -f2)" = "1" ]; then
     38 		snd=""
     39 	else
     40 		snd=""
     41 	fi
     42 
     43 	cpu=$(printf "%03s" "$cpu")
     44 	echo "+@fn=1;+@fn=0; $cpu | +@fn=1;+@fn=0; $mem | +@fn=1;+@fn=0; $dsk | +@fn=1;$baticon+@fn=0; $bat | +@fn=1;$net+@fn=0; $net_strength | +@fn=1;$snd+@fn=0;"
     45 done