Skip to content

Instantly share code, notes, and snippets.

@yojota
Created January 10, 2022 14:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yojota/0631c182628e5b1cbc91fd64e69c8730 to your computer and use it in GitHub Desktop.
Save yojota/0631c182628e5b1cbc91fd64e69c8730 to your computer and use it in GitHub Desktop.
A little script for run a world clock in terminal linux (tmux)
#!/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