World clock applet?

Forum rules
Before you post please read how to get help
Post Reply
User avatar
lonely_llama
Level 1
Level 1
Posts: 20
Joined: Mon Jul 22, 2019 12:08 am

World clock applet?

Post by lonely_llama » Wed Aug 14, 2019 8:26 pm

I switched from Cinnamon to Xfce since my 4 GB laptop even found Cinnamon too heavy to run. What I miss from the Cinnamon dock is a world clock widget. (Specifically, a clock on the taskbar that can show me multiple timezones in the tooltip). There doesn't seem to be one for xfce in Synaptic, is there anything like it from a different source?

User avatar
secureIT
Level 3
Level 3
Posts: 135
Joined: Wed Dec 05, 2018 1:26 pm

Re: World clock applet?

Post by secureIT » Thu Aug 15, 2019 3:26 am

Hi lonely_llama,

One of the ways to display a world clock in Xfce is to install orage.

Code: Select all

apt install orage
After that you will have the orage-panel-plugin.

To show it up, right click on free place of the panel, and choose :
Panel>Add new items
Then add orage.
You will reach the (very well hidden) settings for world clock with a middle-mouse-click on the orage-clock in panel.
In the window, that pops up, you can set the timezones you want to be displayed in it.
Closing of that window : again middle-click on the orage-clock on panel.

Now there are two ways to display that window with the timezones :

Either middle-mouse click on the orage-clock or right click on orage-calendarsymbol an choose worldtime
In der Ruhe liegt die Kraft ! .......... The strenght is to be found in serenity !

User avatar
lonely_llama
Level 1
Level 1
Posts: 20
Joined: Mon Jul 22, 2019 12:08 am

Re: World clock applet?

Post by lonely_llama » Sat Aug 17, 2019 10:16 am

Thanks. Not quite as convenient as a tooltip over the regular clock but better than nothing I guess.

DAMIEN1307
Level 7
Level 7
Posts: 1831
Joined: Tue Feb 21, 2017 8:13 pm
Location: Alamogordo, New Mexico, USA

Re: World clock applet?

Post by DAMIEN1307 » Sat Aug 17, 2019 10:20 am

Just another way you could do this would be through the browser itself...i use this method because the only time i would even need to check times elsewhere is when im already in the browser, dont need it when im offline...i just bookmark it in the browser and its quick and easy...website to bookmark is provided below...DAMIEN
ORDO AB CHAO

User avatar
secureIT
Level 3
Level 3
Posts: 135
Joined: Wed Dec 05, 2018 1:26 pm

Re: World clock applet?

Post by secureIT » Sun Aug 18, 2019 3:18 pm

Couldnt find a way until yet ( also with scripting) that will show tooltip over the regular clock in Xfce.
But as i am interested in such athing, i will work on it.

I found another way to show the worldtime on screen with a known script modyfied for use with YAD.
May be it is also usual for you, so that you dont need orage-calendar.

The original bash-script came from : delta99 @ stackoverflow.com

This works flawlessly in Terminal but as it points to :
zoneinfo=/usr/share/zoneinfo
there may be duplicates in it.

But let us go later to this point.

original script to try :

Code: Select all

#!/bin/bash                                                    

# Show date and time in other time zones, with multiple args                                        


elements=$@

zoneinfo=/usr/share/zoneinfo/right
format='%a %F %T'

for search in ${elements[@]}; do

  find $zoneinfo -type f \
      | grep -i "$search" \
       | while read z
        do
            d=$(TZ=$z date +"$format")
            printf "%-34s %23s\n" ${z#$zoneinfo} "$d"
        done
done
How to use it in Xfce :

Copy script to libreoffice writer text-file and save it as wdate.txt in

Code: Select all

~/bin
into your home directory (if bin-folder does not exist into your home : simply create it)

Next step : make it executable (the easy way) :
open thunar, go to ~bin/wdate.txt and rename it to wdate (without extension)
then right-click on it and choose >properties >acessrights and mark > file may be started as a program

Now you can start it in Terminal with clock-Arguments in that way :

Code: Select all

wdate Berlin New_York Los_Angeles
Then you will see a output like this:

Code: Select all

$ wdate Berlin New_York Los_Angeles
/Europe/Berlin                      So 2019-08-18 20:21:48
/America/New_York                   So 2019-08-18 14:21:48
/America/Los_Angeles                So 2019-08-18 11:21:48
Play around with it a while to see how its function is.

I modyfied the script for displaying multiple clock-windows on your screen (in a row) with yad

To use the following script you must install yad.

Code: Select all

apt install yad
here is modyfied script :

Code: Select all

#!/bin/bash
# Show date and time in other time zones, with multiple args                                                     
# script adapted from delta99 @ stackoverflow.com
# modyfied by secureIT @ forums.linuxmint.com for displaying multiple clock-windows on the screen (in a row) with yad
# script needs yad : apt-install yad
# name of script : wdate1
# version : 1.0
#                                     
# width of clocks
width=250
#
# initial x-position on screen
pos=10

elements=$@

zoneinfo=/usr/share/zoneinfo/right
format='%a %F %T'

for search in ${elements[@]}; do

  find $zoneinfo -type f \
      | grep -i "$search" \
       | while read z
        do
            d=$(TZ=$z date +"$format")
            printf "%-34s %23s\n" ${z#$zoneinfo} "$d" | tee >(yad --undecorated --borders=0 --no-buttons --geometry=250x50+${pos}+10 --text-info --wrap --fore=yellow --back=black)
        done
# set x-position of next clock-window
pos=$(($pos + $width))
done
# show clock-windows for 10 seconds, then close them
(sleep 10s && killall yad) &
exit
note : as you can see in the script, I changed the path among other things, so that no more duplicate issues are displayed.

Copy script to libreoffice writer text-file and save it as wdate1.txt in

Code: Select all

~/bin
into your home directory
Next step : make it executable (the easy way) :
open thunar, go to ~bin/wdate1.txt and rename it to wdate1 (without extension)
then right-click on it and choose >properties >acessrights and mark > file may be started as a program

Now you can create a launcher with :

Code: Select all

Name: YAD-worldclock
Comment: YAD-worldclock
Command: wdate1 Berlin Los_Angeles New_York Japan Adelaide
This is only an example.

Try it with your choice :
wdate1 Nameofcity Nameofcity Nameofcity Nameofcity …...and so on ( but keep in mind that a clock-window is 250 pixels wide, and that only as many as the total width of the screen will fit.
…….and do not forget the spaces in between the starter command.

See vid of it in action :
https://streamable.com/blvjr
In der Ruhe liegt die Kraft ! .......... The strenght is to be found in serenity !

Post Reply

Return to “Xfce”