Saturday, February 21, 2009

Clock Screensavers

Windows XP has several screensavers to choose from, but Linux has many more of them. Many (if not most) of the Linux screensavers can be configured and tweaked quite a bit, and the user has much more control over things than would be possible in XP.

My favorite is the clock screensaver that comes with KDE.

Choosing and setting up a screensaver in KDE is easy. Right-click anywhere on the desktop and click on "Configure Desktop..." Click on the button for the Screen Saver module, and there you can choose and set up one of the screensavers:



Above, I've selected KDE's clock screensaver. Here's a shot of the "Setup" screen:



As you can see, you can configure the colors of each part of the clock, and the clock's size, etc.

For GNOME, Xfce, Openbox, etc., I had to find some other type of way to get a clock screensaver, because KDE's clock screensaver isn't available. I use the xscreensaver GLText (clock) screensaver.

Setting up a clock screensaver with xscreensaver involves a bit more work than doing it with KDE's screensavers. Here's an overview:

Linux Mint and Ubuntu Hardy come with gnome-screensaver, which I uninstalled. Then I installed xscreensaver, xscreensaver-data-extra, xscreensaver-gl-extra. The package xscreensaver-gl was already present.

From a terminal, the command xscreensaver-demo opens a window where you can select and configure a screensaver:



I click on "Settings..." to set up the GLText (clock) screensaver. Then I click the "Advanced >>" button and insert this line for the command line text:

gltext -root -spin 0 -text "%A%n%d %b%n%r"

That gives me the digital, text clock that's shown. Here's a view of the standard and advanced settings windows:





You'll probably have to add xscreensaver & to your list of apps that start up when you log into the system. Or else you'll have to go to a terminal and start the screensaver manually -- you can use xscreensaver-demo to get to the window where you start things up.

Getting the xscreensaver GLText (clock) screensaver set up can be a bit tricky, and things might be different in various distros. In Ubuntu Dapper, my notes show that I edited the file /usr/share/gnome-screensaver/themes/gltext.desktop so that the line

Exec=gltext -root

was changed to

Exec= gltext -text “%A%n%d %b %Y%n%l:%M:%S %p” -no-spin

But the file /usr/share/gnome-screensaver/themes/gltext.desktop was not present in Hardy.

In Debian Etch's GNOME, I think all I did was install xscreensaver-gl, and then the clock screensaver was easy to configure.

I referenced the Linux manpage called by the command man date to find a list of the codes to use in the GLText (clock) screensaver. Here's a list copied from that manpage:

%a locale’s abbreviated weekday name (e.g., Sun)

%A locale’s full weekday name (e.g., Sunday)

%b locale’s abbreviated month name (e.g., Jan)

%B locale’s full month name (e.g., January)

%c locale’s date and time (e.g., Thu Mar 3 23:05:25 2005)

%C century; like %Y, except omit last two digits (e.g., 21)

%d day of month (e.g, 01)

%D date; same as %m/%d/%y

%e day of month, space padded; same as %_d

%F full date; same as %Y-%m-%d

%g last two digits of year of ISO week number (see %G)

%G year of ISO week number (see %V); normally useful only with %V

%h same as %b

%H hour (00..23)

%I hour (01..12)

%j day of year (001..366)

%k hour ( 0..23)

%l hour ( 1..12)

%m month (01..12)

%M minute (00..59)

%n a newline

%N nanoseconds (000000000..999999999)

%p locale’s equivalent of either AM or PM; blank if not known

%P like %p, but lower case

%r locale’s 12-hour clock time (e.g., 11:11:04 PM)

%R 24-hour hour and minute; same as %H:%M

%s seconds since 1970-01-01 00:00:00 UTC

%S second (00..60)

%t a tab

%T time; same as %H:%M:%S

%u day of week (1..7); 1 is Monday

%U week number of year, with Sunday as first day of week (00..53)

%V ISO week number, with Monday as first day of week (01..53)

%w day of week (0..6); 0 is Sunday

%W week number of year, with Monday as first day of week (00..53)

%x locale’s date representation (e.g., 12/31/99)

%X locale’s time representation (e.g., 23:13:48)

%y last two digits of year (00..99)

%Y year

%z +hhmm numeric timezone (e.g., -0400)

%:z +hh:mm numeric timezone (e.g., -04:00)

%::z +hh:mm:ss numeric time zone (e.g., -04:00:00)

%:::z numeric time zone with : to necessary precision (e.g., -04,
+05:30)

%Z alphabetic time zone abbreviation (e.g., EDT)


A note about xscreensaver and the GLText screensaver:


You may also want to refer to man xscreensaver, man xscreensaver-text, man xscreensaver-demo, etc., and the manpages mentioned in those pages. And, of course, a few Google searches wouldn't hurt.

No comments: