tshm
1/31/2014 - 5:35 AM

dzen_showtime.sh

#!/bin/sh
LANG=C
FG="white"
BG="#555"
W=200
X=$(xwininfo -root | awk "/Width:/{print \$2-$W}")
Y=20
GEOM="-fg $FG -bg $BG -y $Y -x $X -w $W"
Heisei=$(expr $(TZ="Asia/Tokyo" date +"%Y") - 1988)

(	echo -n "JST:  H$Heisei/"; \
  TZ="Asia/Tokyo" date "+%m/%d %H:%M"; \
  echo ""; cal; echo -n "^fg(red)Load: "; \
	awk '{print $1,$2,$3}' /proc/loadavg; \
	df|awk '/sda/{l=$3/$2*100;\
	        printf "%s: ^fg(#277)^r(%dx16)^fg(#000)^r(%dx16)",$1,l,100-l;
					printf "^fg(#0f0)^ib(1)^p(-65)^c(0)%s^p(40)x\n",$5; }'; \
	) |\
 dzen2 $GEOM -fn rk16 -sa center -p -l 12 \
 -e 'onstart=uncollapse,unhide;entertitle=exit'