How to modify the clock in the menubar
The clock that appears in dash's menubar is very customizable, as is the
rest of dash. Some of the more common types of things to do are listed
below.
- dash's menubar clock updates once only every five seconds by default.
The clock can be updated every second, if desired, by adding a line
like the following to your ~/.Xresources or ~/.dashrc file:
Dash*menuClock.update: 1
The update time is specified in seconds. If you set the update time
to one second, you may wish to change the format of the time
displayed as described below, to include the seconds in the display.
Seconds are not normally displayed by default, because the update
time is only every fifth second. This default is likely to change in
a future release.
** WARNING **
If you set the udpate frequency to one second, and you monitor your
workstation's load using "xload", you may notice that your load
climbs to one and stays there for a period of time. This load is not
real, however, and workstation performance is not adversely affected.
This "problem" is caused by a strange interaction between dash and
the Unix kernel which we hope to have corrected in the next release.
- by default, dash's menubar clock displays the time in a format
similar to that returned by the "date" command, like so:
Wed Jan 1 12:01 1991
This format is controllable by a format string which is similar to
the formatting available in the C language "printf" function. The
default formatting string is specified in dash's applications-defaults
file like so:
Dash*menuClock.format: %.3w %.3n %2D %02e:%02m 19%Y
An explanation of these fields follows:
o each special field begins with a percent sign (%).
o this is followed by an optional field width specifier:
a number before a decimal point specifying the minimum
field width, padded on the left with spaces (or zeroes, if
begun with a zero), if necesarry. A negative number
indicates padding should occur on the right instead.
a number following a decimal point specifying the
maximum field width, if the field is a string, or the number
of digits following a decimal point if the field is a number
o a "special character", which is replaced with some part of the
current date, as follows:
'w' = weekday name (Monday - Sunday)
'n' = monthname (January - December)
'M' = Month number (1 - 12)
'D' = Day of month (1 - {28,30,31})
'Y' = Year number (no century - ex: 91)
'e' = european time (24 hour time)
'h' = hour number (1 - 12)
'm' = minute (0 - 60)
's' = seconds (0 - 60)
'A' = AMPM ("AM" or "PM")
'a' = ampm ("am" or "pm")
'z' = timeZone (ex: EDT, EST, CDT, CST, etc.)
'o' = day Of year (1 - 366)
This set of "variables" allows for a large degree of customization.
For example, to make the clock's format read like so:
Time: Monday, 1/1 12:01:02a
one would use a menuClock resource like so:
Dash*menuClock.format: Time: %w %M/%D %2h:%02m:%02s%.1a
As you can see, menuClock formats can contain abitrary text as well
as the special fields described above.
|