A long while ago, I had a clock set to say things like morning, day, evening, night, for time in a panel app. Broad stroke, not very specific, It might have been a KDE desktop. I am in Ubuntu Mate now, is there a way to get this vague time description in the mate panel?
Textual / speaking clock for Mate and other Ubuntu variants
Although the question was originally about Ubuntu Mate, luckily, from 15.10, indicators can be used on
Mate
as well. As a result, the answer below at least works forUnity
andMate
and (tested) onXubuntu
.A GUI to change settings is still to follow (working on it), but I tested the indicator below for at least 20 hrs, and (as expected) it did the job without an error.
Options
The indicator offers the following options:
Show the textual time
Show the textual "day-area" (night, morning, day, evening)
Show a.m. / p.m.
Show all of them at once (or any combination of the three)
Speak out the time every quarter of an hour (
espeak
required)Optionally, the time is displayed fuzzy; rounded on five minutes, e.g.
10:43 ->
quarter to eleven
.The script, the module and an icon
The solution exists of a script, a separate module and an icon, which you need to store in one and the same directory.
The icon:
Right-clck on it and save it as (exactly)
indicator_icon.png
The module:
This is the module that produces the textual time and all other displayed information. Copy the code, save it as (again, exactly)
tcalc.py
, together with the icon above in one and the same directory.The script:
This is the actual indicator. Copy the code, save it as
moderntimes.py
, together with the icon and th module above in one and the same directory.How to use
The script needs
espeak
:Copy all three files above into one and the same directory, exactly named as indicated in The script, the module and an icon
In the head of the script (
moderntimes.py
), define which information should be displayed, and how. Simply setTrue
orFalse
in the line:In the head of the module, you can change the hours when to start subsequently morning, day, evening, night, in the line:
Don't touch anything else in the script for now :)
Ubuntu Mate users need to enable the use of indicators on their system: choose System > Preferences > Look and feel > Mate tweak > Interface > "Enable indicators"
Run the indicator with the command:
Running it from Startup Applications
Remember that if you run the command from Startup Applications, in many cases you need to add a little break, especially (among others) on indicators:
Notes
No doubt the script will be changed/updated in the next few days many times. One thing I'd like feedback on in particular is the "style" in which the digital time is converted into textual time. The way it is done now:
whole hours, e.g.:
less then 30 mins after the hour, e.g.
30 mins after the hour e.g.:
more the 30 mins e.g.:
15 minutes are mentioned
quarter
, e.g.:exception is midnight, which is not called
zero
, butmidnight
, e.g.:The script is extremely low on juice, due to the fact that after the first timecheck- loop, the loop is synchronized on the computer clock automatically. Therefore the script checks time/edits the displayed time only once per minute, sleeping the rest of the time.
Edit
As per today (2016-4-9), a ppa of a polished version is available. To install from ppa:
The day periods in this version are changed, compared to the script version above, now it is:
... and the indicator has tho option to change the icon during daytime:
morning/afternoon/evening/night:
As mentioned, this version was tested on both
Mate
(from the original question)Unity
andXubuntu
.If you have Kubuntu (Plasma Desktop Ubuntu distro), you have a built-in widget called "fuzzy clock" -- it's been around at least since 14.04, or as long ago as Plasma 4 has been out, and it's still in Plasma 5 as found in Kubuntu 16.04.
Fuzzy Clock can be set to be as "accurate" as five minute increments, like reading an analog clock (say, "ten after four"), but it also has three "fuzzier" settings, one of which gives readings like "afternoon" and one that just gives "Weekend!" (on a Sunday afternoon -- I presume it'll say "Monday" tomorrow).
I don't know if fuzzy clock is available in other Ubuntu flavors -- I saw it in xfce (as found in Xubuntu) on my system, but the OS was installed as Kubuntu, so I'm not sure if the fuzzy clock is native to xfce as well as KDE/Plasma, nor whether it's available in Unity or Mate.