p-e-w / argos

Create GNOME Shell extensions in seconds
https://extensions.gnome.org/extension/1176/argos/
1.67k stars 114 forks source link

Not really an issue, but a plea for help #15

Closed GrouchyGaijin closed 7 years ago

GrouchyGaijin commented 7 years ago

Hi Guys,

I do a lot of work for a company in China and I often need to know what time it is there. Granted, I can click my clock in the panel and look at the world clocks, but what I would like to do is have Beijing time displayed in the panel along with my local time. I was able to add Beijing's time to the panel using a bash script I found that was written for Bitbar:

#!/bin/bash
# <bitbar.title>Timezones+</bitbar.title>
# <bitbar.version>v1.0</bitbar.version>
# <bitbar.author>Aaron Edell</bitbar.author>
# <bitbar.author.github>aaronedell</bitbar.author.github>
# <bitbar.desc>Rotates current time through four common timezones </bitbar.desc>
# <bitbar.image>http://i.imgur.com/Y4nhdZo.png</bitbar.image>
# <bitbar.dependencies>Bash GNU AWK</bitbar.dependencies>
echo -n "Beijing " ; TZ=":Asia/Shanghai +'%l:%M %p

The problem is that the time displayed in the panel does not update. Does anyone know how I can make this script update every 60 seconds? `

Hippyjake commented 7 years ago

Name the script something like timezone.5s.sh The "5s" makes it update every 5 seconds. timezone.1m.sh will do the trick also.

:neckbeard: :grinning:

#!/bin/bash

# <bitbar.title>Timezones+</bitbar.title>
# <bitbar.version>v1.0</bitbar.version>
# <bitbar.author>Aaron Edell</bitbar.author>
# <bitbar.author.github>aaronedell</bitbar.author.github>
# <bitbar.desc>Rotates current time through four common timezones</bitbar.desc>
# <bitbar.image>http://i.imgur.com/Y4nhdZo.png</bitbar.image>
# <bitbar.dependencies>Bash GNU AWK</bitbar.dependencies>

echo -n "Beijing " ; TZ="Asia/Shanghai" date +'%l:%M %p'
VVhitehead commented 7 years ago

I think you can also make it update when clicked on with: echo -n "Beijing " ; TZ="Asia/Shanghai" date +'%l:%M %p | refresh=true'

Hippyjake commented 7 years ago

@WhiteheadV I tried refresh=true it didn't work tho.

p-e-w commented 7 years ago

@Hippyjake: refresh=true should definitely work. What is the output of your script, when run from the terminal?

Hippyjake commented 7 years ago

A copy pasta from above returns Beijing 8:13 AM | refresh=true

http://i.imgur.com/LAlL19v.png

Hippyjake commented 7 years ago

I got it to work! I was being a dork ha.

p-e-w commented 7 years ago

Cool! Closing this issue then.