XScreenSaver is a screen saver and locker for the X Window System.zh-CN:Xscreensaver
- 1 Installing XScreenSaver
- 2 Configuring XScreenSaver
- 3 Starting XScreenSaver
- 4 Lock Screen
- 5 Disabling XScreenSaver for Media Applications
- 6 Using XScreenSaver as animated wallpaper
- 7 Theming
- 8 User switching from the lock screen
- 9 See Also
Alternatively, there is a patched version with the Arch Linux logo in the AUR named AUR. Running this package instead of the one available in the official repositories is advantageous for several reasons:
- Since makepkg is compiling it from source code, the resulting package will contain processor-specific optimizations unique to your specific system -- assuming you set up your
/etc/makepkg.confwith the appropriate CFLAGS and CXXFLAGS.
- This package is Arch-branded (screensavers, lock screen, etc.)
- If running GNOME, this package will provide an icon to enter the XScreenSaver preferences under System>Preferences>Screensaver whereas the package in the official repositories does not.
Global options are defined in
/usr/share/X11/app-defaults/XScreenSaver. Under a standard setup, there is likely no need to edit this file. Instead most options are configured on a user-by-user basis simply by running xscreensaver-demo
XScreenSaver manages display energy saving (DPMS) independently of X itself and overrides it. To configure the timings for standby, display poweroff and such, use xscreensaver-demo or edit the configuration file manually, e.g.
timeout: 1:00:00 cycle: 0:05:00 lock: False lockTimeout: 0:00:00 passwdTimeout: 0:00:30 fade: True unfade: False fadeSeconds: 0:00:03 fadeTicks: 20 dpmsEnabled: True dpmsStandby: 2:00:00 dpmsSuspend: 2:00:00 dpmsOff: 4:00:00
Simply installing the package is not enough to have it run automatically. The
xscreensaver program has to be started, which is commonly done by the desktop environment via a line in
~/.xinitrc as follows:
/usr/bin/xscreensaver -no-splash &
& argument makes the
xscreensaver program run in the background and is required.
/etc/xdg/xfce4/xinitrc, to ensure it gets executed use
exec startxfce4 --with-ck-launch
If operating with multiple users with a display manager (e.g. SLiM, GDM, KDM) it is best to start XScreenSaver via the desktop manager's native screensaver interface. This allows full management of user switching. For example, if using GNOME, install and but only have
gnome-screensaver active. This allows for all the screensavers to be selected, and keep the ability for user switching in the event that one user has the screen locked, and another user wants to "switch users" to he/she can access to the box.
Another option to retain multi-user support, without having to install a second screensaver, is to modify either
~/.xscreensaver for per-user settings, or
/usr/share/X11/app-defaults/XScreenSaver for global settings, and add the following line.
You may immediately trigger
xscreensaver, if it is running, and lock the screen with the following command:
$ xscreensaver-command --lock
Automatically lock when suspending/sleeping/hibernating
Create the following file:
[Unit] Description=Lock X session using xscreensaver Before=sleep.target [Service] User=yourusername Type=oneshot Environment=DISPLAY=:0 ExecStart=/usr/bin/xscreensaver-command -lock [Install] WantedBy=sleep.target
and enable it with
# systemctl enable xscreensaver
You may want to set XScreenSaver's fade out time to 0.
Disabling XScreenSaver for Media Applications
Add the following to
heartbeat-cmd="xscreensaver-command -deactivate >&- 2>&- &"
There is no native support within XBMC to disable XScreenSaver (although XBMC does come with its own screensaver). A 3rd party application available in the AUR called AUR does just this. Once running, simply add
xbmc.bin to the list of apps for automatic activation.
There is no native way to disable XScreenSaver for flash, but there is script named lightsOn that works great and has support for Firefox's Flash plugin, Chromium's Flash plugin, MPlayer, and VLC.
Using XScreenSaver as animated wallpaper
You can run
xscreensaver in the background, just like a wallpaper.
First, kill any process that is controlling the background (the root window).
Locate the desired XScreenSaver executable (they are usually on
/usr/lib/xscreensaver/) and run it with the
-root flag, like this
$ /usr/lib/xscreensaver/glslideshow -root &
XScreenSaver as wallpaper under xcompmgr
xcompmgr may cause problems, so you need to use xwinwrap to run it in order to use it as wallpaper. You can find it as AUR.AUR in the
Run it with the following command:
$ xwinwrap -b -fs -sp -fs -nf -ov -- /usr/lib/xscreensaver/glslideshow -root -window-id WID &
User switching from the lock screen
By default, xscreensaver's "New Login" button in the lock screen will call
/usr/bin/gdmflexiserver to allow for user switching. This is fine if using gdm or kdm. Other display managers such as lightdm and lxdm support this functionality as well.
Simply paste the following into
~/.xscreensaver to use LXDM's switching mode:
newLoginCommand: lxdm -c USER_SWITCH
Simply paste the following into
~/.xscreensaver to use lightdm's switching mode:
newLoginCommand: dm-tool switch-to-greeter
PanicLock -- Lock your screen and close any selected programs in background.