Created
January 10, 2022 14:46
-
-
Save yojota/0631c182628e5b1cbc91fd64e69c8730 to your computer and use it in GitHub Desktop.
A little script for run a world clock in terminal linux (tmux)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#TimeZones | |
#TZ='America/Mexico_City' tty-clock -sct -f "%a, %d %b %Y %T %z" | |
#TZ='America/Bogota' tty-clock -sct -f "%a, %d %b %Y %T %z" | |
#TZ='America/Lima' tty-clock -sct -f "%a, %d %b %Y %T %z" | |
#TZ='America/New_York' tty-clock -C 3 -sct -f "%a, %d %b %Y %T %z" | |
#TZ='America/Argentina/Jujuy' tty-clock -sctx -f "%a, %d %b %Y %T %z" | |
# reference https://en.wikipedia.org/wiki/List_of_tz_database_time_zones | |
if ! command -v tty-clock &> /dev/null | |
then | |
echo "tty-clock could not be found" | |
#install tty-clock | |
sudo apt -y install tty-clock | |
fi | |
if ! command -v tmux &> /dev/null | |
then | |
echo "tmux could not be found" | |
#install tty-clock | |
sudo apt -y install tmux | |
fi | |
tmux new-session \; \ | |
send-keys 'TZ='America/New_York' tty-clock -C 3 -sct -f "%a, %d %b %Y %T %z %Z"' C-m \; \ | |
split-window -h -p 70 \; \ | |
split-window -v -p 70 \; \ | |
split-window -v -p 50 \; \ | |
select-pane -t 2 \; \ | |
send-keys 'TZ='America/Argentina/Jujuy' tty-clock -sctx -f "%a, %d %b %Y %T %z %Z"' C-m \; \ | |
select-pane -t 3 \; \ | |
send-keys 'TZ='America/Mexico_City' tty-clock -sct -f "%a, %d %b %Y %T %z %Z"' C-m \; \ | |
select-pane -t 4 \; \ | |
send-keys 'TZ='America/Bogota' tty-clock -sct -f "%a, %d %b %Y %T %z %Z"' C-m \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment