Created
July 30, 2020 06:57
-
-
Save erkiesken/e13943550c4b2ba03779d5eac5b75e47 to your computer and use it in GitHub Desktop.
bitbar local and utc timezone
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
#!/usr/bin/env bash | |
echo "${1}" | pbcopy |
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
#!/usr/bin/env bash | |
# <bitbar.title>UTC and local timezone</bitbar.title> | |
# <bitbar.version>v1.0.0</bitbar.version> | |
# <bitbar.author>Erki Esken</bitbar.author> | |
# <bitbar.author.github>erkiesken</bitbar.author.github> | |
# <bitbar.desc>Show the current time in local and UTC timezone.</bitbar.desc> | |
TIME_UTC=$(TZ="UTC" date "+%H:%M") | |
TIME_LOCAL=$(date "+%H:%M") | |
TIME_EPOCH=$(date "+%s") | |
TIME_DATE=$(date "+%A, %m/%d") | |
TIME_DATE_ISO=$(TZ="UTC" date "+%Y-%m-%dT%H:%M:00Z") | |
nice_numbers() { | |
local s=$1 | |
s="${s//0/๐ถ}" | |
s="${s//1/๐ท}" | |
s="${s//2/๐ธ}" | |
s="${s//3/๐น}" | |
s="${s//4/๐บ}" | |
s="${s//5/๐ป}" | |
s="${s//6/๐ผ}" | |
s="${s//7/๐ฝ}" | |
s="${s//8/๐พ}" | |
s="${s//9/๐ฟ}" | |
echo "${s}" | |
} | |
nice_numbers "๐ โ${TIME_LOCAL} ๐ คโ${TIME_UTC}" | |
echo "---" | |
echo "${TIME_DATE} | color=#999999" | |
echo "Unix: ${TIME_EPOCH} | color=#999999 bash='~/bin/pbcopy.sh' param1='${TIME_EPOCH}' terminal=false refresh=false" | |
echo "${TIME_DATE_ISO}| color=#999999 bash='~/bin/pbcopy.sh' param1='${TIME_DATE_ISO}' terminal=false refresh=false" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment