agnoster-theme-baz-plugin/plugin/functions/__command_rprompt
Ari Archer ef9160c4a6
init
Signed-off-by: Ari Archer <ari.web.xyz@gmail.com>
2022-06-18 23:04:43 +03:00

9 lines
314 B
Bash

local times= n=$COLUMNS tz
for tz in ZRH:Europe/Zurich PIT:US/Eastern \
MTV:US/Pacific TOK:Asia/Tokyo; do
[ $n -gt 40 ] || break
times="$times ${tz%%:*}\e[30;1m:\e[0;36;1m"
times="$times$(TZ=${tz#*:} date +%H:%M)\e[0m"
n=$(( $n - 10 ))
done
[ -z "$times" ] || printf "%${n}s$times\\r" ''