Search:  
Gentoo Wiki

TIP_Screensaver_in_Background


 XOrg IndexConfigurationHIDevices
FontsVideo CardsMonitors  


Contents

Intro

There's lots of beautiful screensavers in Portage, the best perhaps being skyrocket and the rss-glx collection. But what's the point of having all this eyecandy if you hardly ever get to see it? Wouldn't it be better to have it waiting for you when you come to log in? Well, now you can! You will need to emerge "xscreensaver" before continuing if you haven't already done so.

GDM

OK, first thing is to set up gdm (I use 2.5.90.1, but it looks like 2.4.1.7 should work). As root, launch gdmsetup and set local login to standard greeter with no background. Then open xscreensaver-demo, find your favourite screensaver, hit Settings, Advanced, and note down the command line. Convert the program to a full path - if it isn't in your path, it's probably in /usr/lib/misc/xscreensaver. Then, edit /etc/X11/gdm/gdm.conf, find the BackgroundProgram line and set it to something like:

File: /etc/X11/gdm/gdm.conf
BackgroundProgram=/usr/lib/misc/xscreensaver/skyrocket --root

or

# BackgroundProgram=/usr/lib/misc/xscreensaver/xmatrix -root -small -delay 20000
Now restart gdm
/etc/init.d/gdm restart

and watch the screensaver paint the root window behind the login box! What other OS can do that?

Note, to make this works after you log in remove nautilus from your session so that it wont start when you log into gnome, this will leave you with the default grey background... but you can now run xscreensaver as a background, along with Xearth Xplanet and Xaquarium.

KDM

First of all, disable the regular kdm background in the kdm configuration utility (somewhere in kcontrol you can do this). There are 2 files that need editing. They are both located in /usr/kde/<kde version>/share/config/kdm/ (replace <kde version> with 3.3 or another version)

First file: Xsetup

This script gets run every time the login screen appears. We will start the screensaver here. Just append the line to start the screensaver to the file. For example, as root type:

echo '/usr/lib/misc/xscreensaver/pong -root &' >>/usr/kde/3.4/share/config/kdm/Xsetup

Obviously you can just as well use an editor to append this line.

Second file: Xstartup

This script (/usr/kde/3.4/share/config/kdm/Xstartup) gets run every time someone logs in. That is exactly when the screensaver should stop running (or it will keep consuming cpu cycles!).

Kill the screensaver from this file. A killall <screensaver name> will usually be good enough to do this. Instead of appending the line to this file, put it before the last line (not sure this is really a must). For the above example you would add:

killall pong

Notes

there are two gotchas here, and i thought i'd point them out...

  1. this is an either/or if you use the composite extension (true-transparency etc.) at least at the moment..
  2. if you use multiple desktops, a killall <screesaver> will nuke the other one as well, unless you use two different ones (not sure if xscreensaver will let that fly.. havent tried yet..

in short, you are still faced with decisions.. you cant have all your eyekandy at once .. yet..

Also, when compiling xscreensaver it gave me a warning about needing gtk in the use flags. I ignored this, and it seems to work fine for me.

XDM

It didn't test this yet, but I bet it works just the same as in kdm. Just use Xsetup and Xstartup files that come with xdm (they are almost always in /etc/X11/xdm/ or /usr/lib/X11/xdm/).

Problems

If it doesn't work, it's probably because the permisions on your hardware accelerated video driver nodes are too restrictive. Note that the background program will run as gdm, not as root, so if you're using an nvidia card with the binary drivers you need to make sure that gdm can write to /dev/nvidia0 and /dev/nvidiactl. I acheive this by making gdm a member of the video group and making /dev/nvidia* owned by root:video, permissions 660 in /etc/devfs.d/nvidia.conf:

File: /etc/devfs.d/nvidia.conf
LOOKUP          ^nvidia           MODLOAD nvidia
REGISTER        ^nvidia           PERMISSIONS root.video 660

and also making sure both columns are 0660 for the <dri> alias in /etc/security/console.perms:

File: /etc/security/console.perms
<xconsole> 0660 <dri>        0660 root.video

After you've logged in

If another program is competing for the desktop image *cough* nautilus *cough*, then you may experience problems. But just run from the commandline /usr/lib/misc/xscreensaver/foo -root.

Credits

Original Forum Post by ecatmur

kdm method is inspired by posts in this thread.

Retrieved from "http://www.gentoo-wiki.info/TIP_Screensaver_in_Background"

Last modified: Sun, 07 Sep 2008 06:10:00 +0000 Hits: 42,099