Rewrite tz.sh to print vertical columns

This commit is contained in:
Ceda EI 2018-10-27 12:57:40 +05:30
parent d0c745f58d
commit 029ce6ed21
2 changed files with 18 additions and 9 deletions

23
tz.sh
View File

@ -1,11 +1,20 @@
#!/usr/bin/env bash
timezone() {
echo '${font BankGothic Md BT:pixelsize=30}${alignr}'${2}: $(TZ=$1 date +%H:%M)'${font}'
places=(Europe/Vilnius Asia/Tehran Europe/Oslo Europe/Dublin Australia/Victoria)
names=(Vilnius Tehran Oslo Dublin Victoria)
n_character(){
echo -n "$(python3 -c "print('{:<$1}'.format(\"$2\"))")"
}
timezone Europe/Vilnius Vilnius
timezone Asia/Tehran Tehran
timezone Europe/Oslo Oslo
timezone Europe/Dublin Dublin
timezone Australia/Victoria Victoria
echo -n '${font Roboto Mono:pixelsize=20}'
for i in ${names[@]}; do
n_character 15 $i
done
echo '${font}'
echo -n '${font Roboto Mono:pixelsize=30}'
for i in ${places[@]}; do
n_character 10 $(TZ=$i date +%H:%M)
done
echo '${font}'

View File

@ -1,4 +1,4 @@
alignment bottom_right
alignment bottom_middle
background no
border_width 5
default_color ffffff
@ -6,7 +6,7 @@ double_buffer yes
draw_borders no
draw_outline no
draw_shades no
gap_x 50
gap_x 0
gap_y 50
maximum_width 1000
minimum_size 175