diff options
| author | Akshay Nair <phenax5@gmail.com> | 2022-03-03 23:15:35 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2022-03-03 23:15:35 +0530 |
| commit | 6094a9fa1548a1b6ca510d0707f1d317121f75ea (patch) | |
| tree | 0610ae5a52e2c55268e410b15622352ff27350c0 /scripts/bin | |
| parent | e160c24728bad4076f148b0a31de92f88df365d8 (diff) | |
| download | nixos-config-6094a9fa1548a1b6ca510d0707f1d317121f75ea.tar.gz nixos-config-6094a9fa1548a1b6ca510d0707f1d317121f75ea.zip | |
config sync
Diffstat (limited to 'scripts/bin')
| -rwxr-xr-x | scripts/bin/clocks | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/bin/clocks b/scripts/bin/clocks new file mode 100755 index 0000000..ee10ac1 --- /dev/null +++ b/scripts/bin/clocks @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +format="%H:%M" +current_time=$(date +"$format") +time="${1:-$current_time}" + +C_RESET=`tput sgr0` +C_GRAY="$(tput setaf 7)$(tput dim)"; +C_HIGHLIGHT="$(tput setaf 7)$(tput bold)" + +label() { printf "$C_GRAY$1: $C_HIGHLIGHT"; } +space() { echo -e "$C_RESET"; } + +space + +label "IST -> CET" +TZ=CET date --date="$time IST" +"$format CET" + +space + +label "CET -> IST" +date --date="$time CET" +"$format IST" + +space |
