Can I make the seconds update in clock tooltip?

Please post suggestions for improvement of Cinnamon on:
https://github.com/linuxmint/Cinnamon
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Post Reply
User avatar
QuanOnTheCob
Level 1
Level 1
Posts: 1
Joined: Wed Mar 27, 2024 10:46 am
Location: Vietnam

Can I make the seconds update in clock tooltip?

Post by QuanOnTheCob »

I'm trying to customise the date format for the taskbar Cinnamon clock. I want to set it so that the taskbar clock will only show the hours and the minutes, but the tooltip for when I hover over the clock will also include the seconds. Problem is the seconds only update every time a new minute is reached, not every second like I expected (so it will display 22:19:00 for the entire minute).

If I add the seconds to the taskbar as well then the tooltip works, the seconds actually update as expected. But if I understand correctly, leaving it like this will increase the power consumption (though I'm not sure if the increase is considerable or not).

So is there any way to make the tooltip update the seconds? Or make the calendar include the clock with seconds when the taskbar clock is clicked on.

(This was a feature in Windows 10 that got removed in Windows 11. Now Windows 11 only let you display the seconds in the taskbar, and I'm pretty annoyed with that and I hope I can make it work here)
User avatar
PaulL
Level 6
Level 6
Posts: 1089
Joined: Mon Apr 24, 2023 10:57 am
Location: Connecticut

Re: Can I make the seconds update in clock tooltip?

Post by PaulL »

On the clock in my panel (which is the applet calendar@cinnamon.org), I can get the seconds to show in the panel, but the tooltip never displays seconds. I'm not even sure why the developers bothered to provide a tool tip, since it only duplicates information you can already see before making the tool tip show up.

I see three alternatives: (1) do some exploring to see if there's an app out there that will give you what you want; (2) rewrite the code to make the tooltip work as you wish (this is open-source software, after all); or (3) accustom yourself to the idea that Linux is not Windows and doesn't do things the way Windows does. (Frankly, in my book that is a very good thing.
billyswong
Level 8
Level 8
Posts: 2240
Joined: Wed Aug 14, 2019 1:02 am

Re: Can I make the seconds update in clock tooltip?

Post by billyswong »

Problem is indeed from a subtle bug in the calendar applet. https://github.com/linuxmint/cinnamon/b ... /applet.js

The update interval of the calendar applet depends on the this.clock = new CinnamonDesktop.WallClock(); in line 37, combined with this.clock.set_format_string within the _updateFormatString() { paragraph below line 197. The WallClock is designed to interpret an update interval according to the format string passed to it. And since the applet is only passing the on-panel time format but not the tooltip time format, tooltip containing seconds cannot trigger the applet to update per second.

I haven't got a bug-fix work yet. But this is what I found so far.
billyswong
Level 8
Level 8
Posts: 2240
Joined: Wed Aug 14, 2019 1:02 am

Re: Can I make the seconds update in clock tooltip?

Post by billyswong »

Update: I filed a bug for this issue https://github.com/linuxmint/cinnamon/issues/12140 and also uploaded my fix. Try that code in your own risk.

I think my code there is too ad-hoc, patching around the existing code in a bare minimum and not clean logically. But it works as a band-aid.
Post Reply

Return to “Cinnamon”