SyntaxHighlighter

2012-02-15

Fedora 16 - Gnome 3: Remove Weekday From Top Panel

I will admit, having used Gnome 2.x for years on my main desktop computer, jumping into Fedora 16 with Gnome 3 was a bit of a culture shock for me.  Of course, to be safe, I didn't muck with my main computer, but threw FC16 onto my old MSI Wind netbook just in case things went seriously awry.

There have been a few minor issues, and being one who absolutely hates change I will admit that my first impressions of Gnome 3 were not very flattering.  After all, everything was soooo...  Different.  Now a few weeks into using it, and quite a bit of tweaking, it is not too bad.  Especially considering this netbook is not exactly a speed demon, it runs relatively well.  (And of course anything is better than the Windows XP that shipped on this little machine.)



Yet, as nice as the look and feel of the GUI is for Gnome 3, there are just a few things that bothered me.  One of them was that I really did not like having the weekday showing up at the top of my screen:

Tues 15:28

Personally, I do not want to know what day of the week it is, unless it happens to be Saturday or Sunday.  After a few Google searches, I could not find anything definitive in regards to removing the weekday from the top panel.

One of the cool things about Gnome 3 is that many of the settings for its look and feel are defined in .css and .js files.  After trial and error I discovered that the weekday can be removed by editing the following file:

  /usr/share/gnome-shell/js/ui/dateMenu.js

You should find the following around line 178:

case '24h':
if (showDate)
 /* Translators: This is the time format with date used
    in 24-hour mode. */
clockFormat = showSeconds ? _("%a %b %e, %R:%S")
                          : _("%a %b %e, %R");
else
 /* Translators: This is the time format without date used
    in 24-hour mode. */
clockFormat = showSeconds ? _("%a %R:%S")
                          : _("%a %R");
     break;
case '12h':
 default:
   if (showDate)
 /* Translators: This is a time format with date used
    for AM/PM. */
clockFormat = showSeconds ? _("%a %b %e, %l:%M:%S %p")
                          : _("%a %b %e, %l:%M %p");
else
 /* Translators: This is a time format without date used
                 for AM/PM. */
clockFormat = showSeconds ? _("%a %l:%M:%S %p")
                          : _("%l:%M %p");
     break;

Case '24h' is the 24 hour clock, while case '12h' is the AM/PM clock.  The variable %a is what displays the shortened weekday before the time in the top panel.  So if you remove the %a and save the dateMenu.js file (using 'sudo gedit dateMenu.js' in shell):

clockFormat = showSeconds ? _("%R:%S")
                          : _("%R");

Then press Alt F2, r (Enter) to restart Gnome the date should be gone.


Also, if you do not like the abbreviated weekday (Tues), and instead would like the full name (Tuesday), change the lower-case %a to upper-case %A for all instances.

DON'T forget that when you update the kernel it will probably overwrite the changes, so make sure to make a backup of this file somewhere in your home directory so you can copy it back after doing any updates.

No comments:

Post a Comment