The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   UNIX - General (http://hintsforums.macworld.com/forumdisplay.php?f=16)
-   -   Customizing the menu bar clock (http://hintsforums.macworld.com/showthread.php?t=12619)

localhost 06-12-2003 10:03 PM

Customizing the menu bar clock
 
I love this hint (probably one of my all time favorites, actually), but can never get it to work exactly to my liking. Here is a screenshot of what the current configuration looks like. The string in .GlobalPreferences.plist reads:
Code:

%a, %m/%e - %I:%M
My question: how do I remove the leading zeros that appear in 06 (the month) and 09 (the hour)? Is there something I'm missing in the strftime man page?

Thanks,
localhost

mervTormel 06-12-2003 11:14 PM

via the shell date command:

%l (that's an ell) will make the hour canonical.

i don't see the canonical form of numeric month in man strftime.

djn1 06-13-2003 07:18 AM

Re: Customizing the menu bar clock
 
Quote:

Originally posted by localhost
I love this hint
I've posted, not because I have a solution (I've looked at man strftime and I don't think you can do what you want - which is basically what Merv said), but because I hadn't come across this hint and think it's excellent. Thanks.

On the assumption that I can probably remember what month it is, mine now reads as:

%1H:%M:%S (%a %e)

i.e. the time followed by the day and day of the month in brackets.

localhost 06-13-2003 07:29 AM

I've got it! Tacking a "1" on after the % and before the parameter turns the parameter conical. Mine now reads:
Code:

%a, %1m/%e - %1I:%M
I figured this out by enabling the stock Apple version of the clock, and saw what string it used.

Thanks for all the help!

djn1 06-13-2003 07:48 AM

Quote:

Originally posted by localhost
I've got it!
Well done, mine is now:
Code:

%1H:%M:%S (%a %1e)

Jacques 06-13-2003 10:00 AM

Why not use PTHClock? You can customize it with your font choice and it has excellent calendar options, worth a shot.

djn1 06-13-2003 10:07 AM

Quote:

Originally posted by Jacques
Why not use PTHClock? You can customize it with your font choice and it has excellent calendar options, worth a shot.
Where's the fun in that? Tinkering about with a normally hidden .plist file is much more rewarding ;)

Actually, I have tried PTHClock but didn't really use it much differently from the menubar clock so removed it some time ago. Also, despite having a ridiculously large number of background processes running, I would rather amend an existing piece of software than add another yet another one.

Jacques 06-13-2003 10:13 AM

I like to use my own font, that's the biggest plus for me.

Quote:

Originally posted by djn1
..I would rather amend an existing piece of software than add another yet another one..
I've been curious about this one. If you disable Apple's menu bar clock and enable PTHClock - isn't that one background process, regardless of which way you go?

..or does Apple's background process, the one that's responsible for the menu bar clock enabled, run regardless of whether you use it or not?

hmm

djn1 06-13-2003 10:21 AM

Quote:

Originally posted by Jacques
..or does Apple's background process, the one that's responsible for the menu bar clock enabled, run regardless of whether you use it or not?
I checked this out a while ago and, as far as I could tell, it makes no difference whether you have the menubar clock enabled or not. For example, top reports the same number of running processes either way. This doesn't mean to say that the system overhead remains the same in both conditions, but I couldn't determine what that difference might be.

Guybrush 06-13-2003 05:28 PM

Editing that file has side-effects
 
If you edit that file it will affect programs like iPhoto or any other program that uses NSDateFormatString i think.

If you only want to customize the clock its just better to edit the clock properties itself rather than a global change, the file you are looking for is:

/System/Library/CoreServices/Menu Extras/Clock.menu/Contents/Resources/English.lproj/Localizable.strings

best thing to do is to open a console and change to that dir, if you have project builder installed you can just do:

sudo open Localizable.strings
if not you can open it with TextEdit:
sudo open -a "TextEdit Localizable.strings"

then edit the string:
"MBC_CLOCK_FORMAT_STRING ="

i changed mine to:
"MBC_CLOCK_FORMAT_STRING" = "%a, %e %b %Y %time%p";

save it, and logout and in again to make the change.

My clock now reads: Fri, 13 Jun 2003 23:24

total changes i made are:
Code:

/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
/* The following 3 strings are used to set up the format the menu bar clock will use    */

/*  Localizations needs to follow these instructions for the menu clock to work properly. */

/*  MBC_CLOCK_FORMAT_STRING is the main format string.  It MUST contain a %a, %time, and %p */
/*        The order of the items can vary and any additional characters or punctuation is ok */
/*        For example, you could put the short day of week at the END of the menu bar clock by */
/*        changing the format to: "%time%p %a" */
"MBC_CLOCK_FORMAT_STRING" = "%a, %e %b %Y %time%p";


/* MBC_CLOCK_REMOVE_AMPM_STRING is a string that is used to REMOVE the AM/PM display when a user */
/*        turns off display AM/PM (or selects 24 hour formats).  This string MUST contain %p.  It should */
/*        also contain any additional characters that need to be removed when the AM/PM isn't being */
/*        displayed.  For example, a format that wanted a dash to appear before the AM/PM would be: */
/*        "%a %time-%p".  To remove it when a user turns off AM/PM display, the MBC_CLOCK_REMOVE_AMPM_STRING */
/*        should contain "-%p" */
"MBC_CLOCK_REMOVE_AMPM_STRING" = "%p";


/* MBC_CLOCK_REMOVE_DAYOFWEEK_STRING is a string used to REMOVE the short day of week display when a user */
/*        turns off the show day of week option in the preferences.  This string MUST contain %a. It should */
/*        also contain any additional characters that need to be removed when the day of week isn't being */
/*        displayed.  For example, the US time format puts a space between the day of week and the start of */
/*        the time so MBC_CLOCK_REMOVE_DAYOFWEEK_STRING containds "%a " */
"MBC_CLOCK_REMOVE_DAYOFWEEK_STRING" = "%a, ";

/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/


djn1 06-13-2003 05:44 PM

Re: Editing that file has side-effects
 
Quote:

Originally posted by Guybrush
If you edit that file it will affect programs like iPhoto or any other program that uses NSDateFormatString i think.
Thanks for that, I've made the changes.

mervTormel 06-13-2003 05:45 PM

grammatically, there is no need for a comma between a word and a number

and i'm usually pretty sure what year it is :D

a terse timestamp:

Fri 13 Jun 2:44

i'm usually pretty sure when it is AM or PM, also

djn1 06-13-2003 05:48 PM

Quote:

Originally posted by mervTormel
i'm usually pretty sure what year it is

a terse timestamp:

Fri 13 Jun 2:44

i'm usually pretty sure when it is AM or PM, also
Mine reads:

22:46 (Fri 13)

... because I like 24 hour clocks, think the brackets look neater and, unlike Merv, I can also remember what month it is ;)

mervTormel 06-13-2003 06:06 PM

ha! good one. (mumble rassum frassum ridicule my granularity, will ya?)

(contents between parentheses are to be ignored)

(not a very good literary device, either)

(shut up, you!)

{backing out, slowly}

but, but, but, without the month, i'd need a comma (or some other delimiter), and i despise the, uh, /delimiter/. in that, uh, context.

djn1 06-13-2003 06:12 PM

Quote:

Originally posted by mervTormel
ha! good one. (mumble rassum frassum ridicule my granularity, will ya?)

(contents between parentheses are to be ignored)

(not a very good literary device, either)

(shut up, you!)

{backing out, slowly}

but, but, but, without the month, i'd need a comma (or some other delimiter), and i despise the, uh, /delimiter/. in that, uh, context.
Easy, and even more terse than your last effort:

2:44 Fri 13

... problem solved :D

zeb 06-13-2003 06:22 PM

... I use PTHClock...

15:20:45

with

Fri 06·13

on the mouse over (those of us without a regular job who sit around in an RV with no real connection to the real world need to be reminded of the day of the week)

oooh... and double-clicking brings out a calendar? GREAT! I couldn't ask for more.

djn1 06-13-2003 06:33 PM

Quote:

Originally posted by zeb
... I use PTHClock...
But that's too easy. The difference here is like when you walk up or climb a mountain yourself rather than driving, getting the cable-car, or whatever. When you get to the top the details of the landscape are objectively the same but the view and the experience are qualitatively different. Or am I being too geeky about this? Merv? ;)

zeb 06-13-2003 06:40 PM

Quote:

Originally posted by djn1
The difference here is like when you walk up or climb a mountain yourself rather than driving, getting the cable-car, or whatever.
Sounds like your making a mountian out of a mole hill... (sorry, couldn't resist)... I've hacked the system plenty (not to boast), and found that PTHClock is exactly what I wanted - I honestly couldn't ask for more. And because of that, I am willing to give a little of my system resources to have it running. I use the 'double-click' calendar a lot... uh, the one across the room is, well, not close enough. (I actually have to get up to see it! jeeze!):D

mervTormel 06-13-2003 06:40 PM

geeky? yes. loquacious? doubly so :]

PTHclock here because of color and font and handy quick calendar features.

djn1 06-13-2003 06:51 PM

OK, I give up - I installed it, mainly because I realised I could turn MenuCalendar off (which always annoyed me because the calendar wouldn't autohide). And you're both right - it's sufficiently customizable to meet all the needs that I can think of :rolleyes:

mervTormel 06-13-2003 07:01 PM

zeb, FYI, you can get your calendar with a single click and auto-dismiss it by switching applications.

zeb 06-13-2003 07:37 PM

I had tried that, but realized that I often wanted the calendar up while in other apps, and that I liked the single click to bring PTHClock to the foreground to access the prefs... thanks though...


All times are GMT -5. The time now is 06:08 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.