XScreenSaver FAQ


These FAQs are about the X11 (Linux, BSD, etc.) version of XScreenSaver.

These FAQs don't apply to the MacOS version. There aren't any FAQs about the MacOS version because, well, unlike Linux, MacOS just works. Sad but true.

Please also read the manual. I think it's a pretty good manual. It's long, but it's subdivided fairly sensibly. This document answers the questions that are answered in the manual that people ask about a lot anyway, plus some random other questions that didn't really seem to fit in the manual itself.


  1. How do I make xscreensaver show a slideshow of images?
  2. How do I make xscreensaver play a video clip?
  3. Where does the text for those silly quotes come from?
  4. How do I run a particular program when the screen blanks/unblanks?
  5. When I'm logged in as root, xscreensaver won't lock my screen!
  6. When I'm logged in as root, xscreensaver won't launch at all!
  7. Ok, I'm not logged in as root; but how do I use system administration GUIs that want me to be root?
  8. Why is the xscreensaver executable setuid to root? That scares me, is it dangerous?
  9. You crashed my X server! You bastard!
  10. The screensaver activates when I'm not idle! It's not noticing my mouse clicks or mouse wheel.
  11. Programs sometimes pop up dialog boxes over the screen saver while my display is locked, and I wish they didn't.
  12. Some of these graphics demos suck. How do I edit out the ones I don't like?
  13. I deleted the hacks I don't like from my .xscreensaver file, but they re-appeared!
  14. Can I activate or disable the screen saver by moving the mouse to a particular corner of the screen?
  15. With some other screensavers, there is a special key you can type while the screensaver is running that will change the graphics demo it's running instead of turning off the screen saver. Why doesn't xscreensaver do that too?
  16. How about putting a "Logout" button on the password dialog, for lab use?
  17. Shouldn't xscreensaver disable Ctrl-Alt-Backspace while the screen is locked?
  18. How do I unlock my screen with RFID or NFC or a fingerprint reader or retina scanner or something?
  19. The demo that's running right now is cool, how do I find out which one it is?
  20. When xscreensaver kicks in, my machine gets slow. Is there a way to tell it to not run graphics demos?
  21. How do I prevent xscreensaver from blanking the screen when I'm watching movies on my computer?
  22. The manual says that xscreensaver will stop running graphics demos when my monitor goes into power-saving mode, but it doesn't. Why?
  23. Sometimes (but not always) my monitor doesn't go into power-saving mode.
  24. The unlock dialog is funny looking, why not use GTK?
  25. I'm running KDE, and it's ignoring my changes, or all the modes aren't listed, or it's behaving weird in some other random way. What gives?
  26. I'm running GNOME, and everything's broken! What's wrong?
  27. I'm just learning X, and I want to write a screensaver. Where should I start?



  1. How do I make xscreensaver show a slideshow of images?

    You do this by using a program that can display a list of images on the root window. One such program, glslideshow is included with xscreensaver. It displays a sequence of images, slowly panning and zooming through them, and fading smoothly from one image to the next. Just select "GLSlideshow" in the xscreensaver control panel, and enter the directory (or RSS URL) where your images live on the "Advanced" tab.

    If you want to only run a slideshow, then select GLSlideshow in "Only One Screen Saver" mode. Otherwise, the slideshow it will be just one of the display modes that xscreensaver will select from randomly, and run for the length of time specified in the `cycle' preference.

    If your graphics card is extremely old, you may find that glslideshow doesn't run fast enough. This is unlikely: any graphics card manufactured in this century should be fast enough. But, if you try it and it is slow, then you'll want to run a different program. Two good choices for displaying slideshows on very old machines with no graphics acceleration are chbg and xv. To use those, you need to add a line to the `programs' preference in your .xscreensaver file:

    GLSlideshow: Just select it from the list; and specify your image directory on the "Advanced" tab.

    chbg:
    default-n: chbg -xscreensaver -randomize   \
                    -interval 0.30             \
                    -R $HOME/images/         \n\
    
    
    xv:
    default-n: xv -root -rmode 5 -random       \
                  -viewonly -wloop -wait 30    \
                  $HOME/images/*.jpg         \n\


  2. How do I make xscreensaver play a video clip?

    To play MP4, MPEG, QuickTime, FLV and AVI videos:

    To play SWF Flash animations:

    To play anything else:


  3. Where does the random text come from?

    See the 'Advanced' tab on the xscreensaver control panel.


  4. How do I run a particular program when the screen blanks/unblanks?

    You can do that using xscreensaver-command -watch. See the xscreensaver-command manual for an example.


  5. When I'm logged in as root, xscreensaver won't lock my screen!

    Don't log in as root.

    Please note that xscreensaver works fine as a screen saver when you are logged in as root: it will not, however, lock your screen when you are logged in as root. This is for good and insurmountable security reasons.

    In order for it to be safe for xscreensaver to be launched by xdm, certain precautions had to be taken, among them that xscreensaver never runs as root. In particular, if it is launched as root (as xdm is likely to do), xscreensaver will disavow its privileges, and switch itself to a safe user id (such as "nobody".)

    An implication of this is that if you log in as root on the console, xscreensaver will refuse to lock the screen (because it can't tell the difference between root being logged in on the console, and a normal user being logged in on the console but xscreensaver having been launched by the xdm "Xsetup" file.)

    The solution to this is simple: you shouldn't be logging in on the console as root in the first place! (What, are you crazy or something?)

    Proper Unix hygiene dictates that you should log in as yourself, and su to root as necessary. People who spend their day logged in as root are just begging for disaster.


  6. When I'm logged in as root, xscreensaver won't launch at all!

    Don't log in as root.

    As described above, xscreensaver disavows its privileges if it finds that it is running as root, for security reasons. An unfortunate side-effect of this is that it may conflict with cookie-based authentication.

    If the X server is running as one user (e.g., "root") and xscreensaver is running as another user (e.g., "nobody") then the xscreensaver process might not be allowed to connect to the X display at all, since it isn't running as the same user.

    One way around this is to run the command xhost +localhost before launching xscreensaver.

    But beware! This will give access to the X server to anyone capable of logging in to the local machine, and in some environments, that could be considered an unacceptable security risk.

    This is discussed in more detail in the "Using GDM" section of the xscreensaver manual.


  7. Ok, I'm not logged in as root; but how do I use system administration GUIs that want me to be root?

    If you're logged in as a normal user, and you `su' to root to run some sysadmin-oriented X program, you might find yourself staring at an error message like

    There are two ways around this. The first is to allow any program running on the local machine to access your X server:

    If you don't trust the other people who have accounts on the local machine, that would not be a good idea, because they will then be able to snoop your display. However, you can make it so that only root has access to your X display. This is slightly more complicated, but safer:

    The above will extract the X access cookie from the .Xauthority file in your home directory, and write it into the .Xauthority in root's home directory, making it possible for root to access your display.

    (Note that this is not a solution for making xscreensaver be able to lock the screen as root. Stop logging in as root and you will stop caring about that.)


  8. Why is the xscreensaver executable setuid to root? That scares me, is it dangerous?

    Maybe it doesn't need to be on your system. Try it and see.

    On many systems, only "root" can access the password database. In order to function as a screen-locker, xscreensaver needs to be able to tell when you've typed the correct password. That means that on those systems, xscreensaver needs to run as root, briefly, at startup. Immediately after startup, and before connecting to the X server, xscreensaver disavows its root privileges, and from then on, runs as an unprivileged user. The amount of code that actually runs as root is very small, and has been examined with great care.

    If your system doesn't use shadow passwords, or if your system uses PAM (and PAM is installed correctly!), then xscreensaver will work even if it is not setuid. If you're concerned, try turning off the setuid bit, restart it, and see if you can still unlock the screen. If so, great.


  9. You crashed my X server! You bastard!

    I'm sorry. But the fact is that an X server crash is, by definition, a bug in the X server.

    The rule is that absolutely nothing a client program throws at the X server should make it crash. When an X client does something wrong, the server is supposed to return an error, causing the client to exit. If the server itself goes down, that's a bug in the server. There may also be a bug in the client -- but probably not.

    This also goes for DRI, GL, and any vendor- or hardware-specific libraries you might be using. If something in xscreensaver caused your display to freeze, or logged you out, or made your monitor explode, I can pretty much guarantee you that the bug is in your X server or your video driver, and not in xscreensaver.

    Try upgrading your X server and video drivers. If that doesn't help, you can try running each display mode in turn until you figure out which one is triggering the X server bug. It is most likely to be one of the GL (3D) screensavers, since those are the ones that actually take advantage of your video hardware. When you figure out which one is causing the crash, you now have a reproducible test case! Congratulations. Please report that to the vendor of your X server and/or your video drivers so that they can fix the problem.

    Turning off acceleration in your X server may also make the problem go away, but that will also slow your machine down a lot.

    If that still brings you no joy, then I recommend switching to MacOS. I did.

    The MacOS version of XScreenSaver works great, incidentally, and has never, ever crashed my machine.


  10. The screensaver activates when I'm not idle! It's not noticing my mouse clicks or mouse wheel.

    On most X11 systems, this is unfortunately the case, and there's no way around it. XScreenSaver notices all keyboard activity; and every few seconds, it checks the position of the mouse. If there have been no keystrokes or mouse motion, it assumes you are idle. It cannot detect mouse clicks, nor the scroll wheel.

    This is because, for no good reason, the X Window System does not allow programs to "snoop" on mouse clicks (though snooping of keystrokes and mouse positions is permitted!)


  11. Programs sometimes pop up dialog boxes over the screen saver while my display is locked, and I wish they didn't.

    Some window managers allow programs to pop windows above xscreensaver, and some do not.

    Every few minutes, xscreensaver will raise itself above any other windows that have popped up, but it can't prevent other programs from popping up their windows in the first place. So they will appear for a little while, and then be hidden.

    If this is happening and it bothers you, switching to a different window manager may fix it.

    You might consider this a bug in your window manager (though some consider it a feature.) If you think it's a bug, then the magic incantation to repeat to the author of your window manager is as follows: "you should be mapping windows with XRestackWindows instead of XRaiseWindow, to ensure that managed windows always appear below override-redirect windows."

    It is also possible that the application that is popping up the window is doing so using an override-redirect window of its own. (This is currently the case with GTK_WINDOW_POPUP style dialogs.) In that case, it is impossible for either xscreensaver or the window manager to prevent those windows from popping up, since override-redirect windows, by definition, bypass the window manager. So, there's no way around that without either: A) changing those applications to use normal windows instead, or B) creating a new extension to X11 itself.

    In particular, Metacity can't prevent these dialogs any more than xscreensaver can. (GNOME bug 154529.)


  12. Some of these graphics demos suck. How do I edit out the ones I don't like?

    Run the xscreensaver-demo program. On the left is a list of all of the demos. Each has a checkbox next to it. Un-check the ones you don't like. Only the ones that are checked will be automatically run by the xscreensaver daemon (though you can still run the others explicitly by double-clicking on them in the xscreensaver-demo window.)

    After you've run xscreensaver-demo once, you will have a .xscreensaver file in your home directory. You can also just edit that file directly: disable the ones you don't like by putting a minus (-) at the beginning of the line. The xscreensaver daemon will notice when the file has changed and reload it automatically.


  13. I deleted the hacks I don't like from my .xscreensaver file, but they re-appeared!

    Instead of deleting them from the file, comment them out by putting a minus (-) at the beginning of the line. Or, just use the xscreensaver-demo program to de-select the ones you don't like, which does the same thing.

    Your .xscreensaver file needs to contain a complete list of all the available screen savers so that xscreensaver can tell when new ones have been added, as a result of a newer version of xscreensaver having been installed.


  14. Can I activate or disable the screen saver by moving the mouse to a particular corner of the screen?

    If you want that, there is a program called Brightside that lets you assign configurable actions to your screen corners, including screen saver actions.

    The reason this behavior is not built in to xscreensaver is that I find it non-obvious, non-discoverable, and counter-intuitive. I believe that an interface like the existing Gnome "Lock Screen" panel icon is far more sensible.


  15. With some other screensavers, there is a special key you can type while the screensaver is running that will change the graphics demo it's running instead of turning off the screen saver. Why doesn't xscreensaver do that too?

    While it's not a bad idea, this is difficult to implement in such a way that it would work on all systems. On some systems, xscreensaver decides when to activate/deactivate by monitoring keyboard and mouse activity directly. But on some systems, a more efficient method is used: instead, the X server sends messages to xscreensaver telling it when to activate and deactivate.

    So in the latter case, xscreensaver only knows that it has been told to deactivate: it has no way of knowing which key was pressed.


  16. How about putting a "Logout" button on the password dialog, for lab use?

    If gdmflexiserver is installed on your system, there should be a "New Login" button on xscreensaver's unlock dialog. If that doesn't appear or doesn't work right, check the setting of the "newLoginCommand" preference in the XScreenSaver.ad app-defaults file.


  17. Shouldn't xscreensaver disable Ctrl-Alt-Backspace while the screen is locked?

    Yes, it should. Unfortunately, that's not possible with current versions of XFree86 or XOrg. It's as if the developers of X11 and the Linux kernel want to make it as hard as possible for you to lock your screen.

    Backdoor #1: Ctrl-Alt-Backspace.

    This keystroke kills the X server, and on some systems, leaves you at a text console. If the user launched X11 manually, that text console will still be logged in. To disable this keystroke globally and permanently, you need to set the DontZap flag in your xorg.conf or XF86Config or XF86Config-4 file (whichever name is in use on your system). See the manual for XF86Config (or variant) for more details.

    Backdoor #2: Ctrl-Alt-F1, Ctrl-Alt-F2, etc.

    These keystrokes will switch to a different virtual console, while leaving the console that X11 is running on locked. If you left a shell logged in on another virtual console, it is unprotected. So don't leave yourself logged in on other consoles. You can disable VT switching globally and permanently by setting DontVTSwitch in your xorg.conf, but that might make your system harder to use.

    Backdoor #3: Alt-SysRq-F.

    This is the Linux kernel "OOM-killer" keystroke. It shoots down random long-running programs of its choosing, and so might might target and kill xscreensaver, and there's no way for xscreensaver to protect itself from that. You can disable it globally with: sudo 'echo 176 > /proc/sys/kernel/sysrq'

    Backdoor #4: Ctrl-Alt-KP_Multiply.

    This keystroke kills any X11 app that holds a lock, so typing this will kill xscreensaver and unlock the screen. This "feature" showed up in the X server in 2008, and as of 2011, some vendors are shipping it turned on by default. How nice. You can disable it by turning off AllowClosedownGrabs in xorg.conf.

    There's little that I can do to make the screen locker secure so long as the kernel and X11 developers are actively working against security. The strength of the lock on your front door doesn't matter much so long as someone else in the house insists on leaving a key under the welcome mat.

    In an ideal world, there would be a single X11 request named something like XGrabMagicKeys() that would, analagously to XGrabKeyboard(), disable all of these magic keystrokes until the grab was released or the program exited. It should be an X11 call, not an ioctl(), and especially not a root-only ioctl(). Needless to say, no such interface exists.


  18. How do I unlock my screen with RFID or NFC or a fingerprint reader or retina scanner or something?

    You can accomplish these things and more by installing the proper PAM module. XScreenSaver doesn't need to be modified at all, since it simply asks the PAM stack to authenticate. Doing it this way also means that the console login prompt can also be made to authenticate in the same way, not just xscreensaver. Check out PAM NFC or similar projects.


  19. The demo that's running right now is cool, how do I find out which one it is?

    Run the xscreensaver-demo program: when its window comes up, one of the elements in the list of display modes will be highlighted by default. That is the one that was most recently running.

    People often suggest that I put the name of the current hack on the password dialog box. I'm not going to do that, because that would be a (non-security-related) feature that was only available if locking was turned on, and most people don't lock their screens. Just launch xscreensaver-demo to see which one it was.


  20. When xscreensaver kicks in, my machine gets slow. Is there a way to tell it to not run graphics demos?

    You can still blank and/or lock your screen, while denying yourself the pleasure of graphical screen savers, by running xscreensaver-demo and selecting "Blank Screen Only" from the "Mode" option menu.

    But is that really necessary? Let's address the real problem: when xscreensaver is blanking the screen, it runs its graphics demos at a low priority, so they should not be stealing cycles from other processes at all -- they should be running only when no other process wants to run. Even if the screen saver was running flat-out with no delays at all (which none do by default), this should result in your load average on an idle machine hovering just slightly above 1.0. (In reality, most savers only run for a fraction of each second, so the load on an otherwise-idle machine should be even lower than that.)

    The exception to this -- and the probable cause of what you are experiencing -- is the OpenGL (3D) demos, when running on machines without 3D hardware. If you don't have hardware-accelerated GL support on your machine, then the GL demos will be serious pigs. (Running them at a low priority doesn't help, for a couple of not-very-good reasons.)

    So, a less drastic fix, in that situation, is to not run the GL demos: un-check any of the 3D hacks, and you can still run the non-resource-itensive graphics demos.

    However, the recommended fix is that you turn over the cushions in your couch, collect the spare change you find, and once you've come up with $10, spend it on a video card that was manufactured after 1998. You will then have a video card with 3D acceleration, and everything will work much, much better.

    It doesn't even need to be fast 3D hardware: things will be notably improved if there is any 3D hardware at all. Seriously, this shouldn't be a problem for any graphics card that was manufactured in the Twenty-First Century. So, if you have a modern card and OpenGL programs aren't fast, then you have a driver problem: the card's 3D hardware is not being used at all, and all the 3D rendering is happening in software.

    Fix that instead.


  21. How do I prevent xscreensaver from blanking the screen when I'm watching movies on my computer?

    If you are using mpv or mplayer, put this in your ~/.mplayer/config file:

    If you're using something else:


  22. The manual says that xscreensaver will stop running graphics demos when my monitor goes into power-saving mode, but it doesn't. Why?

    The only way that xscreensaver can tell that the monitor is in power-saving mode is by asking the X server. There is a server extension specifically for asking these sorts of questions, called "XDPMS", and xscreensaver uses that.

    So it may be that your X server doesn't support the XDPMS extension (you can tell by running "xdpyinfo"). Or, it may be that the extension is supported, but the X server doesn't actually know how to talk to your hardware to ask it whether it is powered on or off. The latter is especially likely on laptops: many laptops have monitor power-saving behavior built in at a very low level that is invisible to Unix and X. On such systems, you can typically only adjust the power-saving delays by changing settings in the BIOS in some hardware-specific way.

    If the Power Management settings in the Preferences panel are grayed out, then that means that either: xscreensaver was compiled without DPMS support; or xscreensaver believes that your system does not support power management.


  23. Sometimes (but not always) my monitor doesn't go into power-saving mode.

    Short answer: your mouse is getting bumped. Cats, trucks, doors, and earthquakes are likely culprits.

    Slightly longer answer: XScreenSaver is responsible for blanking and locking the screen and drawing pretty pictures. However, the X server itself is responsible for powering down the monitor. XScreenSaver is smart enough to ignore tiny mouse motions: if your mouse only moves by a couple of pixels, XScreenSaver ignores that: it only un-blanks the screen when the mouse motion is large. However, the X server doesn't do that: even a single pixel of motion will cause it to power your monitor back on (or prevent your monitor from powering down in the first place.)

    The only way to fix this would be to modify the X server to do what XScreenSaver does, and ignore small mouse motions for power-management idle-detection purposes.


  24. The unlock dialog is funny looking, why not use GTK?

    The short answer is, for security reasons. The unlock dialog is implemented using raw Xlib because it would be very difficult to implement it using a GUI toolkit and still have xscreensaver be secure. More technical details can be found on the On Toolkits page.


  25. I'm running KDE, and it's ignoring my changes, or all the modes aren't listed, or it's behaving weird in some other random way. What gives?

    This means you're not running xscreensaver at all, you're running "kscreensaver". You should stop.

    Instead of using the usual xscreensaver mechanisms, the KDE folks have chosen to roll their own screen saver wrapper that is inferior to the xscreensaver-demo way of doing things in any number of ways.

    The only sensible (and secure) way to use a screen saver under KDE is to turn off KDE's built-in screen saver, and use xscreensaver instead. How you go about this is explained in the "Using KDE" section of the xscreensaver manual.

    In the late 1990s, the GNOME people had the same class of bugs as the KDE folks now have, but the GNOME crew eventually came to their senses, and we worked together to come up with a solution that resulted in their being one and only one xscreensaver configurator, instead of two: mine and theirs.

    Then, in 2005, the next generation of idiots took over GNOME, and went back to the "bad old days" by introducing "gnome-screensaver", so now the GNOME users are screwed again, too.

    Will the KDE people ever wise up? Will the GNOME people wise up a second time? Only time will tell. I encourage you to encourage them to stop this "Not Invented Here" madness.


  26. I'm running GNOME, and everything's broken! What's wrong?

    Possibly you are not running xscreensaver at all, but but are running "gnome-screensaver" instead. You should stop.

    XScreenSaver is secure, stable, and mature; whereas gnome-screensaver is brand new, bug-ridden, unreliable, and a security disaster waiting to happen (for all the reasons outlined in the On Toolkits page).

    Gnome-screensaver was created in 2005 by people who thought it was a better idea to rewrite all of xscreensaver from scratch instead of sending me patches for the changes they desired in xscreensaver itself.

    They are, of course, welcome to shoot themselves in the foot in this way, but there's no reason you should. I don't support gnome-screensaver, and I encourage you to run xscreensaver instead.


  27. I'm just learning to program X, and I want to write an xscreensaver module. Where should I start?

    The file "README.hacking" in the xscreensaver source distribution contains some helpful hints.

    If you come up with anything, send it to me! If it's good, I'd love to include it in the xscreensaver distribution.