Created
April 18, 2024 16:57
-
-
Save jtzero/cc5d24eb559dd09d0ad594cb9ba93f76 to your computer and use it in GitHub Desktop.
Swiftbar WorldClock
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 | |
# Display UTC in the menubar, and one or more additional zones in the drop down. | |
# The current format (HH:MM:SS) works best with a one second refresh, or alter | |
# the format and refresh rate to taste. | |
# | |
# <swiftbar.title>World Clocks</swiftbar.title> | |
# <swiftbar.version>v1.0</swiftbar.version> | |
# <swiftbar.author>Adam Snodgrass, jtzero</swiftbar.author> | |
# <swiftbar.author.github>jtzero</swiftbar.author.github> | |
# <swiftbar.desc>Display current UTC times in the menu bar</xbar.desc> | |
# <swiftbar.image></swiftbar.image> | |
# <swiftbar.var>string(VAR_ZONES="Australia/Sydney Europe/Amsterdam America/New_York America/Los_Angeles"): Space delimited set of timezones</swiftbar.var> | |
ZONES=("America/Chicago" "UTC") | |
for zone in "${ZONES[@]}"; do | |
printf '%s' "$(TZ=$zone date +'%H:%M:%S %Z') " | |
done | |
printf '| font=Monaco' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment