Now I love my Xgl, Compiz and KDE combination, but a few (minor) things have been broken in KDE since Xgl and Compiz took over my machine.
One of these things is the screensaver. You can set a screensaver with KDE’s tools and manually launch it by choosing Lock Screen, but the screensaver would no longer come on by itself regardless of what settings you chose.
Well, there is a solution. Thanks to Noiesmo’s Website for the tip. It actually requires bypassing the KDE screensaver handling and use the older, but Xgl-aware xscreensaver. So the first thing you need to do is install that. Check your distribution’s software management tools and search for and install xscreensaver. A couple of commands for popular distros:
Fedora:$ su -c "yum install xscreensaver"
(K)ubuntu:$ sudo apt-get install xscreensaver
Once that’s installed we need to make a script that starts the xscreensaver program when we log in so it can run the screensaver after the timeout. Copy and paste the following into your favourite text editor.
#!/bin/sh xscreensaver -nosplash &
Save that as ~/.kde/Autostart/xscreen.sh (you might need to show hidden folders to see .kde). Now we need to make that script executable. Browse to ~/.kde/Autostart in the file manager Konqueror and right-click your new xscreen.sh script. Choose Properties, click the Permissions tab and tick ‘is executable’ before clicking OK.
Now we need to start xscreensaver in this session, so press Alt-F2 and type xscreensaver -nosplash & and press Enter. Now press Alt-F2 again and type xscreensaver-demo and press Enter again.
Here is where you choose your screensaver, set timeout options and settings etc. Choose your desired settings and close the program.
Your screensaver should now run after the timeout you specified in xscreensaver-demo. Fixed!
Watch out for the ugly unlocking screen, though, it’s not quite as pretty as KDE’s one.