Created
January 4, 2019 16:16
-
-
Save phildier/7577ab0283fb401aa5f19d381c52d195 to your computer and use it in GitHub Desktop.
Displays the time in various timezones on the xwindows background image
This file contains hidden or 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 | |
| export PATH=/bin:/usr/bin | |
| DISPLAY=":0.0" | |
| FONT=Courier-10-Pitch | |
| FORMAT="%Z (UTC%z) %a %b %e %H:%M" | |
| SIZE=$( | |
| xwininfo -display "$DISPLAY" -root \ | |
| | awk '/Width:/{width=$2}; /Height:/{height=$2} END { print width"x"height }' | |
| ) | |
| LABEL=$( | |
| TZ=America/Los_Angeles date +"$FORMAT" | |
| TZ=America/Chicago date +"$FORMAT" | |
| TZ=America/New_York date +"$FORMAT" | |
| TZ=UTC date +"$FORMAT" | |
| TZ=EET date +"$FORMAT" | |
| ) | |
| convert \ | |
| -size "$SIZE" \ | |
| -background black \ | |
| -fill lightgray \ | |
| -font $FONT \ | |
| -gravity southwest \ | |
| -pointsize 22 \ | |
| label:"$LABEL" \ | |
| jpg:- \ | |
| | xloadimage -display "$DISPLAY" -onroot stdin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment