This script is outdated. Please use the info-timezone script in the official polybar scripts repository.
A custom script to easily switch the timezone of the date displayed.
In the directory where your polybar config file resides, run:
echo UTC-0 >> timezones
Replace UTC-0
with the timezone of your choice. You can add as many timezones as you desire.
Copy tz-switcher.sh
into your config directory
Paste this into your polybar config:
[module/time-switch]
type = custom/script
exec = ~/.config/polybar/tz-switcher.sh
tail = true
click-left = kill -USR1 %pid%
To change the date format, replace FORMAT
variable in tz-switcher.sh with the format of your choice.
Formatting sequences can be found in man date
.