OnWorks favicon

xscreensaver - Online in the Cloud

Run xscreensaver in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command xscreensaver that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator



xscreensaver - extensible screen saver and screen locking framework


xscreensaver [-display host:display.screen] [-verbose] [-no-splash] [-no-capture-stderr]
[-log filename]


The xscreensaver program waits until the keyboard and mouse have been idle for a period,
and then runs a graphics demo chosen at random. It turns off as soon as there is any
mouse or keyboard activity.

This program can lock your terminal in order to prevent others from using it, though its
default mode of operation is merely to display pretty pictures on your screen when it is
not in use.

It also provides configuration and control of your monitor's power-saving features.


For the impatient, try this:
xscreensaver &
The xscreensaver-demo(1) program pops up a dialog box that lets you configure the screen
saver, and experiment with the various display modes.

Note that xscreensaver has a client-server model: the xscreensaver program is a daemon
that runs in the background; it is controlled by the foreground xscreensaver-demo(1) and
xscreensaver-command(1) programs.


The easiest way to configure xscreensaver is to simply run the xscreensaver-demo(1)
program, and change the settings through the GUI. The rest of this manual page describes
lower level ways of changing settings.

I'll repeat that because it's important:

The easy way to configure xscreensaver is to run the xscreensaver-demo(1) program.
You shouldn't need to know any of the stuff described in this manual unless you are
trying to do something tricky, like customize xscreensaver for site-wide use or

Options to xscreensaver are stored in one of two places: in a .xscreensaver file in your
home directory; or in the X resource database. If the .xscreensaver file exists, it
overrides any settings in the resource database.

The syntax of the .xscreensaver file is similar to that of the .Xdefaults file; for
example, to set the timeout parameter in the .xscreensaver file, you would write the
timeout: 5
whereas, in the .Xdefaults file, you would write
xscreensaver.timeout: 5
If you change a setting in the .xscreensaver file while xscreensaver is already running,
it will notice this, and reload the file. (The file will be reloaded the next time the
screen saver needs to take some action, such as blanking or unblanking the screen, or
picking a new graphics mode.)

If you change a setting in your X resource database, or if you want xscreensaver to notice
your changes immediately instead of the next time it wakes up, then you will need to
reload your .Xdefaults file, and then tell the running xscreensaver process to restart
itself, like so:
xrdb < ~/.Xdefaults
xscreensaver-command -restart
If you want to set the system-wide defaults, then make your edits to the xscreensaver app-
defaults file, which should have been installed when xscreensaver itself was installed.
The app-defaults file will usually be named /usr/lib/X11/app-defaults/XScreenSaver, but
different systems might keep it in a different place (for example, /usr/openwin/lib/app-
defaults/XScreenSaver on Solaris.)

When settings are changed in the Preferences dialog box (see above) the current settings
will be written to the .xscreensaver file. (The .Xdefaults file and the app-defaults file
will never be written by xscreensaver itself.)


xscreensaver also accepts a few command-line options, mostly for use when debugging: for
normal operation, you should configure things via the ~/.xscreensaver file.

-display host:display.screen
The X display to use. For displays with multiple screens, XScreenSaver will
manage all screens on the display simultaniously.

Same as setting the verbose resource to true: print diagnostics on stderr and on
the xscreensaver window.

Do not redirect the stdout and stderr streams to the xscreensaver window itself.
If xscreensaver is crashing, you might need to do this in order to see the error

-log filename
This is exactly the same as redirecting stdout and stderr to the given file (for
append). This is useful when reporting bugs.


When it is time to activate the screensaver, a full-screen black window is created on each
screen of the display. Each window is created in such a way that, to any subsequently-
created programs, it will appear to be a "virtual root" window. Because of this, any
program which draws on the root window (and which understands virtual roots) can be used
as a screensaver. The various graphics demos are, in fact, just standalone programs that
know how to draw on the provided window.

When the user becomes active again, the screensaver windows are unmapped, and the running
subprocesses are killed by sending them SIGTERM. This is also how the subprocesses are
killed when the screensaver decides that it's time to run a different demo: the old one is
killed and a new one is launched.

You can control a running screensaver process by using the xscreensaver-command(1) program
(which see.)


Modern X servers contain support to power down the monitor after an idle period. If the
monitor has powered down, then xscreensaver will notice this (after a few minutes), and
will not waste CPU by drawing graphics demos on a black screen. An attempt will also be
made to explicitly power the monitor back up as soon as user activity is detected.

The ~/.xscreensaver file controls the configuration of your display's power management
settings: if you have used xset(1) to change your power management settings, then
xscreensaver will override those changes with the values specified in ~/.xscreensaver (or
with its built-in defaults, if there is no ~/.xscreensaver file yet.)

To change your power management settings, run xscreensaver-demo(1) and change the various
timeouts through the user interface. Alternately, you can edit the ~/.xscreensaver file

If the power management section is grayed out in the xscreensaver-demo(1) window, then
that means that your X server does not support the XDPMS extension, and so control over
the monitor's power state is not available.

If you're using a laptop, don't be surprised if changing the DPMS settings has no effect:
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 adjust the power-saving
delays only by changing settings in the BIOS in some hardware-specific way.

If DPMS seems not to be working with XFree86, make sure the "DPMS" option is set in your
/etc/X11/XF86Config file. See the XF86Config(5) manual for details.


For the better part of a decade, GNOME shipped xscreensaver as-is, and everything just
worked out of the box. In 2005, however, they decided to re-invent the wheel and ship
their own replacement for the xscreensaver daemon called "gnome-screensaver", rather than
improving xscreensaver and contributing their changes back. As a result, the "gnome-
screensaver" program is insecure, bug-ridden, and missing many features of xscreensaver.
You shouldn't use it.

To replace gnome-screensaver with xscreensaver:

1: Fully uninstall the gnome-screensaver package.
sudo apt-get remove gnome-screensaver

2: Launch xscreensaver at login.
Select "Startup Applications" from the menu (or manually launch "gnome-session-
properties") and add "xscreensaver".

3: Make GNOME's "Lock Screen" use xscreensaver.
sudo ln -sf /usr/bin/xscreensaver-command \
That doesn't work under Unity, though. Apparently it has its own built-in screen
locker which is not gnome-screensaver, and cannot be removed, and yet still manages
to be bug-addled and insecure. Keep reinventing that wheel, guys! (If you have
figured out how to replace Unity's locking "feature" with xscreensaver, let me

4: Turn off Unity's built-in blanking.
Open "System Settings / Brightness & Lock";
Un-check "Start Automatically";
Set "Turn screen off when inactive for" to "Never."


Like GNOME, KDE also decided to invent their own screen saver framework from scratch
instead of simply using xscreensaver. To replace the KDE screen saver with xscreensaver,
do the following:

1: Turn off KDE's screen saver.
Open the "Control Center" and select the "Appearance & Themes / Screensaver" page.
Un-check "Start Automatically".

2: Find your Autostart directory.
Open the "System Administration / Paths" page, and see what your "Autostart path"
is set to: it will probably be ~/.kde/Autostart/ or something similar.

3: Make xscreensaver be an Autostart program.
Create a .desktop file in your autostart directory called xscreensaver.desktop that
contains the following five lines:

[Desktop Entry]

4: Make the various "lock session" buttons call xscreensaver.
The file you want to replace next has moved around over the years. It might be
called /usr/libexec/kde4/kscreenlocker, or it might be called "kdesktop_lock" or
"krunner_lock" or "kscreenlocker_greet", and it might be in /usr/lib/kde4/libexec/
or in /usr/kde/3.5/bin/ or even in /usr/bin/, depending on the distro and phase of
the moon. Replace the contents of that file with these two lines:

xscreensaver-command -lock

Make sure the file is executable (chmod a+x).

Now use xscreensaver normally, controlling it via the usual xscreensaver-demo(1) and
xscreensaver-command(1) mechanisms.


If the above didn't do it, and your system has systemd(1), then give this a try:

1: Create a service.
Create the file ~/.config/systemd/user/xscreensaver.service containing:
2. Enable it.
systemctl --user enable xscreensaver
Then restart X11.


Still not working, but on your distro, that newfangled systemd(1) nonsense has already
fallen out of favor? Then maybe this will work: launch the Startup Applications applet,
click "Add", and enter these lines, then restart X11:
Name: XScreenSaver
Command: xscreensaver
Comment: xscreensaver


You can run xscreensaver from your gdm(1) session, so that the screensaver will run even
when nobody is logged in on the console. To do this, run gdmconfig(1) and on the
Background page, type the command "xscreensaver -nosplash" into the Background Program
field. That will cause gdm to run xscreensaver while nobody is logged in, and kill it as
soon as someone does log in. (The user will then be responsible for starting xscreensaver
on their own, if they want.)

Another way to accomplish the same thing is to edit the file /etc/X11/gdm/gdm.conf to
BackgroundProgram=xscreensaver -nosplash
In this situation, the xscreensaver process will probably be running as user gdm instead
of root. You can configure the settings for this nobody-logged-in state (timeouts, DPMS,
etc.) by editing the ~gdm/.xscreensaver file.

To get gdm to run the BackgroundProgram, you may need to switch it from the "Graphical
Greeter" to the "Standard Greeter".

It is safe to run xscreensaver as root (as xdm or gdm may do.) If run as root,
xscreensaver changes its effective user and group ids to something safe (like "nobody")
before connecting to the X server or launching user-specified programs.

An unfortunate side effect of this (important) security precaution is that it may conflict
with cookie-based authentication.

If you get "connection refused" errors when running xscreensaver from gdm, then this
probably means that you have xauth(1) or some other security mechanism turned on. For
information on the X server's access control mechanisms, see the man pages for X(1),
Xsecurity(1), xauth(1), and xhost(1).

Use xscreensaver online using onworks.net services

Free Servers & Workstations

Download Windows & Linux apps

  • 1
    AuthPass is an open source password
    manager with support for the popular and
    proven Keepass (kdbx 3.x AND kdbx 4.x ...
    Download authpass
  • 2
    Zabbix is an enterprise-class open
    source distributed monitoring solution
    designed to monitor and track
    performance and availability of network
    servers, device...
    Download Zabbix
  • 3
    This repository is no longer maintained
    and is kept for archival purposes. See
    https://invent.kde.org/sdk/kdiff3 for
    the newest code and
    Download KDiff3
  • 4
    USBLoaderGX is a GUI for
    Waninkoko's USB Loader, based on
    libwiigui. It allows listing and
    launching Wii games, Gamecube games and
    homebrew on Wii and WiiU...
    Download USBLoaderGX
  • 5
    Firebird RDBMS offers ANSI SQL features
    & runs on Linux, Windows &
    several Unix platforms. Features
    excellent concurrency & performance
    & power...
    Download Firebird
  • 6
    KompoZer is a wysiwyg HTML editor using
    the Mozilla Composer codebase. As
    Nvu's development has been stopped
    in 2005, KompoZer fixes many bugs and
    adds a f...
    Download KompoZer
  • 7
    Free Manga Downloader
    Free Manga Downloader
    The Free Manga Downloader (FMD) is an
    open source application written in
    Object-Pascal for managing and
    downloading manga from various websites.
    This is a mirr...
    Download Free Manga Downloader
  • More »

Linux commands