#!/bin/bash DELAY=20 sep=$(echo -e '\u2502') while true; do currency= if [ ! -z "$(ls -A ~/.cache/currency/)" ] ; then for c in ~/.cache/currency/* ; do currency="$currency$(cat $c) " done currency="$currency$sep " fi if [ -d "/sys/class/power_supply/BAT0/" ]; then bat="$(cat /sys/class/power_supply/BAT0/capacity)%" case "$(cat /sys/class/power_supply/BAT0/status)" in Full) bat_icon='✓' ;; Charging) bat_icon='▲' ;; Discharging) bat_icon='▼' ;; *) bat_icon="(?)" ;; esac bat_string="$bat_icon $bat $sep " fi datetime_string=$(date "+%A $sep %d %h %Y $sep %_I:%M %p (UTC%:::z)") xsetroot -name " $bat_string$datetime_string" || exit sleep "$DELAY" done