GNOME Bugzilla – Bug 669778
Missing an option to hide weekday in clock.
Last modified: 2017-09-11 18:56:36 UTC
The weekday name is hardcoded in the dateMenu.js but I wanted to have an option to hide it. And with small edits I've made a new gsettings key and its' handling. Adding a patch. P.S. I'm not sure if my previous report was sent (I cannot find it anywhere), so I'll post a new one.
P.P.S. Before patching dateMenu.js you need to add a new schema and recompile schemas with # /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas
Created attachment 207219 [details] Patch to add gsettings option to hide weekday in clock
And to set this option use $ gsettings set org.gnome.shell.clock show-weekday false
Hi Сергій. I'm not sure why you want to hide this label. Can you give some more details? We generally don't allow customising the layout in this way, and this doesn't seem like a very useful option.
Besides the fact that after installing many extensions the clock can end up hidden partially of fully behind "..." on a small netbook screen I just want an option to hide everything that I consider useless. At least for me and one my friend who asked me if I could hide it the weekday is not the information that should be displayed always. I'm not sure why you don't allow customizing the layout in this way. Can you give some more details? Which way exactly? Was there a discussion about this?
Ah right, I see. Seems reasonable to have a key for that. We have keys for changing the clock display in other ways, after all.
(In reply to comment #2) > Created an attachment (id=207219) [details] > Patch to add gsettings option to hide weekday in clock Patches should be attached in git's format-patch format (much easier to review!). The current version is not acceptable: clockFormat = showSeconds ? _((showWeekday ? "%a " : "")+"%b %e, %R:%S") : _((showWeekday ? "%a " : "")+"%b %e, %R"); gettext doesn't handle string concatenation, so you are breaking localization. Assuming that the weekday is simply prepended to the format string in any language gnome-shell supports, you should do (at the end of the switch statement): if (showWeekday) clockFormat = "%a " + clockFormat; But the assumption itself is wrong - running git grep -A1 'msgid "%A %B %e, %Y"' -- po shows quite a few locales which add a comma after the weekday, and even a couple where the weekday is located at the end of the format string. So to implement the option, there's no way around doubling the number of format strings - see the code gnome-shell uses nowadays for the clock[0]. The good news there is that it is already possible to hide the weekday, but it is not exposed in GSettings and tied to the date (e.g. it is not possible to hide the weekday and show the date). So let's reassign this to gnome-desktop, which implements the functionality (the corresponding settings are part of gsettings-desktop-schemas). [0] http://git.gnome.org/browse/gnome-desktop/tree/libgnome-desktop/gnome-wall-clock.c#n234
This old bug still comes up No. 1 when searching for how to get rid of the day. Just tried the patches+recompiling the schemas and, though the option appears and can be set (in gnome 3 even!), it does not work. So on to the desktop link: apparently some code has been added. See line 288 (at this writing), which declares: "gboolean show_weekday" However, no such option appears in the current framework and the day-of-week is still eating up valuable space -- and no way to make it disappear.
(In reply to u2nGn from comment #8) > This old bug still comes up No. 1 when searching for how to get rid of the > day. Just tried the patches+recompiling the schemas and, though the option > appears and can be set (in gnome 3 even!), it does not work. See comment #7 - the functionality is no longer implemented in gnome-shell (which is what the patch changes) but in gnome-desktop.
Created attachment 359237 [details] [review] Add a gsettings key to show/hide weekday
Created attachment 359238 [details] [review] wall-clock: respect new clock-show-weekday setting
Since we have the same desire for the Endless shell (avoid showing the weekday), and right now we hardcode it, here are two patches that implement the requested functionality in an upstream-friendly way. Thanks for considering.
Review of attachment 359237 [details] [review]: ::: configure.ac @@ +1,2 @@ AC_PREREQ(2.53) +AC_INIT([gsettings-desktop-schemas], [3.27.0], Can you please bump that separately? Say, after branching.
Review of attachment 359238 [details] [review]: Could you please add a test for this in wall-clock? Verify the before and after changing the setting.
Created attachment 359302 [details] [review] wall-clock: respect new clock-show-weekday setting
Created attachment 359303 [details] [review] build: bump gsettings-desktop-schemas requirement This is needed for the new schema.
Created attachment 359304 [details] [review] Add a gsettings key to show/hide weekday
Created attachment 359305 [details] [review] build: bump version to 3.27.0
Thanks Bastien. I added a test and separated the version bumps in their own commits.
Review of attachment 359302 [details] [review]: Sure.
Review of attachment 359303 [details] [review]: You can merge this into the previous patch, or you'll need to make sure to bump the requirement before the code change.
Review of attachment 359302 [details] [review]: Should be commit after freeze, sorry.
Review of attachment 359304 [details] [review]: Sure.
Review of attachment 359305 [details] [review]: Don't forget to branch gnome-3-24
Attachment 359304 [details] pushed as 4a93810 - Add a gsettings key to show/hide weekday Attachment 359305 [details] pushed as 64231fb - build: bump version to 3.27.0
Attachment 359302 [details] pushed as 84f55f5 - wall-clock: respect new clock-show-weekday setting Branched gsettings-desktop-schemas and gnome-desktop, pushed these to master. Thanks!