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 #!/usr/bin/env bash
timezone() { places=(Europe/Vilnius Asia/Tehran Europe/Oslo Europe/Dublin Australia/Victoria)
echo '${font BankGothic Md BT:pixelsize=30}${alignr}'${2}: $(TZ=$1 date +%H:%M)'${font}' names=(Vilnius Tehran Oslo Dublin Victoria)
n_character(){
echo -n "$(python3 -c "print('{:<$1}'.format(\"$2\"))")"
} }
timezone Europe/Vilnius Vilnius echo -n '${font Roboto Mono:pixelsize=20}'
timezone Asia/Tehran Tehran for i in ${names[@]}; do
timezone Europe/Oslo Oslo n_character 15 $i
timezone Europe/Dublin Dublin done
timezone Australia/Victoria Victoria 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 background no
border_width 5 border_width 5
default_color ffffff default_color ffffff
@ -6,7 +6,7 @@ double_buffer yes
draw_borders no draw_borders no
draw_outline no draw_outline no
draw_shades no draw_shades no
gap_x 50 gap_x 0
gap_y 50 gap_y 50
maximum_width 1000 maximum_width 1000
minimum_size 175 minimum_size 175