From 029ce6ed21b88344058f5f75d9ba7fdc16263128 Mon Sep 17 00:00:00 2001 From: Ceda EI Date: Sat, 27 Oct 2018 12:57:40 +0530 Subject: [PATCH] Rewrite tz.sh to print vertical columns --- tz.sh | 23 ++++++++++++++++------- tz_conky | 4 ++-- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/tz.sh b/tz.sh index 75114ff..6d52408 100755 --- a/tz.sh +++ b/tz.sh @@ -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}' diff --git a/tz_conky b/tz_conky index 1bce356..0d263ac 100644 --- a/tz_conky +++ b/tz_conky @@ -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