Skip to content

Instantly share code, notes, and snippets.

@shapeshed
Created October 1, 2013 12:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shapeshed/6777514 to your computer and use it in GitHub Desktop.
Save shapeshed/6777514 to your computer and use it in GitHub Desktop.
xset +fp /usr/share/fonts/local
xset fp rehash
public_ip(){
echo `wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'`
}
NETWORKICON=`echo -e '\uE0AF'`
BATTERYICON=`echo -e '\uE037'`
CLOCKICON=`echo -e '\uE015'`
PACMANICON=`echo -e '\uE00F'`
while true; do
UPDATES="$(pacman -Qqu | wc -l)"
batt=$(LC_ALL=C acpi -b)
case $batt in
*Discharging*)
batt="${batt#* * * }"
batt="${batt%%, *} "
;;
*)
batt=""
;;
esac
xsetroot -name "$NETWORKICON $(public_ip) $PACMANICON $UPDATES $BATTERYICON $batt $(date +"%F %R")"
sleep 60
done &
exec dwm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment