Difference between revisions of "XScreenSaver"

From ArchWiki
Jump to: navigation, search
(new Xresources section)
(remove useless note, if you don't want the extra dependency, edit the PKGBUILD)
 
(89 intermediate revisions by 23 users not shown)
Line 1: Line 1:
[[Category:X Server]]
+
[[Category:X server]]
 +
[[es:XScreenSaver]]
 +
[[it:XScreenSaver]]
 +
[[ja:XScreenSaver]]
 +
[[zh-cn:XScreenSaver]]
 +
{{Related articles start}}
 +
{{Related|DPMS}}
 +
{{Related|Xresources}}
 +
{{Related|List of applications#Screen lockers}}
 +
{{Related articles end}}
 +
 
 
XScreenSaver is a screen saver and locker for the X Window System.
 
XScreenSaver is a screen saver and locker for the X Window System.
[[es:Xscreensaver]]
 
[[it:Xscreensaver]]
 
[[zh-CN:Xscreensaver]]
 
==Installing XScreenSaver==
 
[[pacman|Install]] the {{Pkg|xscreensaver}} package found in the [[Official Repositories|official repositories]].
 
  
Alternatively, there is a patched version with the Arch Linux logo in the [[Arch User Repository|AUR]] named {{AUR|xscreensaver-arch-logo}}. Running this package instead of the one available in the [[Official Repositories|official repositories]] is advantageous for several reasons:
+
== Installation ==
# 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 {{ic|/etc/makepkg.conf}} with the appropriate [http://en.gentoo-wiki.com/wiki/Safe_Cflags#Processor_Specific_CFLAGS CFLAGS] and CXXFLAGS.
+
 
# This package is Arch-branded (screensavers, lock screen, etc.)
+
[[Install]] the {{Pkg|xscreensaver}} package.
# 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|official repositories]] does not.
+
  
==Configuring XScreenSaver==
+
For an Arch Linux branded experience, install the {{AUR|xscreensaver-arch-logo}} package.
Global options are defined in {{ic|/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-demo
+
== Configuration ==
  
xscreensaver-demo writes the chosen configuration in {{ic|~/.xscreensaver}}, discarding any manual modification to the file.  
+
Most options are configured on a user-by-user basis by running ''xscreensaver-demo''. ''xscreensaver-demo'' writes the chosen configuration to {{ic|~/.xscreensaver}}, discarding any manual modifications to the file.  Global options are defined in {{ic|/usr/share/X11/app-defaults/XScreenSaver}}.
  
Fortunately, since at least XScreenSaver 5.22, there is another way to edit XScreenSaver's user configuration, using {{ic|~/.Xresources}}; see [https://wiki.archlinux.org/index.php/Xdefaults#XScreenSaver_resources here] for some examples.
+
Since at least XScreenSaver 5.22, there is another way to edit XScreenSaver's user configuration, using [[Xresources]]. This includes theming support. See [https://gist.github.com/anonymous/682d8daf5631b588e12e] for the version 5.22 defaults.
 +
 
 +
=== DPMS and blanking settings ===
 +
 
 +
{{Style|"overrides DPMS" is vague - xscreensaver does the equivalent of {{ic|xset s 0 0}}, uses its own timer for the various animations, but sets the DPMS timeout to the values in ''Display Power Management''}}
 +
 
 +
XScreenSaver manages screen blanking and display energy saving ([[DPMS]]) independently of X itself and overrides it. To configure the timings for blanking, standby, display poweroff and such, use ''xscreensaver-demo'' or edit the configuration file manually, e.g. {{ic|~/.xscreensaver}}:
  
===DPMS settings===
 
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. {{ic|~/.xscreensaver}},
 
 
{{bc|
 
{{bc|
 
timeout: 1:00:00
 
timeout: 1:00:00
Line 39: Line 46:
 
}}
 
}}
  
===Xresources===
+
DPMS and screen blanking can be disabled by starting ''xscreensaver-demo'' and, for the ''Mode'' setting, choosing ''Disable Screen Saver''.
  
Control many settings by using {{ic|~/.Xresources}}.  Defaults are located in {{ic|/usr/share/X11/app-defaults/XScreenSaver}}.
+
{{Note|If ''Lock Screen After'' in ''xscreensaver-demo'' is ticked and set to 0 minutes, the screen will be locked immediately upon blanking. If ''Power Manager Enabled'' is unticked, DPMS is disabled; it does not mean that XScreenSaver will relinquish control of DPMS settings.}}
  
Below are all the valid Xresources for version 5.22.
+
== Usage ==
  
{{hc|from: driver/XScreenSaver.ad|<nowiki>xscreensaver.mode: random
+
{{Tip|To start XScreenSaver without the splash screen, use the {{ic|-no-splash}} switch. See {{ic|man xscreensaver}} for a full list of options.}}
xscreensaver.timeout: 0:10:00
+
xscreensaver.cycle: 0:10:00
+
xscreensaver.lockTimeout: 0:00:00
+
xscreensaver.passwdTimeout: 0:00:30
+
xscreensaver.dpmsEnabled: False
+
xscreensaver.dpmsQuickoffEnabled: False
+
xscreensaver.dpmsStandby: 2:00:00
+
xscreensaver.dpmsSuspend: 2:00:00
+
xscreensaver.dpmsOff: 4:00:00
+
xscreensaver.grabDesktopImages: True
+
xscreensaver.grabVideoFrames: False
+
xscreensaver.chooseRandomImages: True
+
  
! This can be a local directory name, or the URL of an RSS or Atom feed.
+
In the [[Xfce]], [[LXDE]] and [[LXQt]] environments, XScreenSaver is autostarted automatically if it is available - no further action is required. For other environments, see [[Autostarting]].
xscreensaver.imageDirectory: /usr/share/wallpapers/
+
xscreensaver.nice: 10
+
xscreensaver.memoryLimit: 0
+
xscreensaver.lock: False
+
xscreensaver.verbose: False
+
xscreensaver.timestamp: True
+
xscreensaver.fade: True
+
xscreensaver.unfade: False
+
xscreensaver.fadeSeconds: 0:00:03
+
xscreensaver.fadeTicks: 20
+
xscreensaver.splash: True
+
xscreensaver.splashDuration: 0:00:05
+
xscreensaver.visualID: default
+
xscreensaver.captureStderr: True
+
xscreensaver.ignoreUninstalledPrograms: False
+
  
xscreensaver.textMode: file
+
To immediately trigger {{ic|xscreensaver}}, if it is running, and lock the screen, execute the following command:
xscreensaver.textLiteral: XScreenSaver
+
xscreensaver.textFile:
+
xscreensaver.textProgram: fortune
+
xscreensaver.textURL: http://en.wikipedia.org/w/index.php?title=Special:NewPages&feed=rss
+
  
xscreensaver.overlayTextForeground: #FFFF00
+
$ xscreensaver-command --lock
xscreensaver.overlayTextBackground: #000000
+
xscreensaver.overlayStderr: True
+
xscreensaver.font: *-medium-r-*-140-*-m-*
+
  
! The default is to use these extensions if available (as noted.)
+
=== Lock on suspend ===
xscreensaver.sgiSaverExtension: True
+
xscreensaver.xidleExtension: True
+
xscreensaver.procInterrupts: True
+
  
! Turning this on makes pointerHysteresis not work.
+
See [[Power management#xss-lock]]. You may want to set XScreenSaver's fade out time to 0.
xscreensaver.xinputExtensionDev: False
+
  
! Set this to True if you are experiencing longstanding XFree86 bug #421
+
=== User switching from the lock screen ===
! (xscreensaver not covering the whole screen)
+
xscreensaver.GetViewPortIsFullOfLies: False
+
  
! This is what the "Demo" button on the splash screen runs (/bin/sh syntax.)
+
{{Warning|When switching users using a display manager such as GDM or LightDM, XScreenSaver will not lock the original session - it can be accessed without a password simply by switching TTY's to the session in question. If you are using LightDM, as a workaround, install {{Pkg|light-locker}} and run it alongside XscreenSaver. Alternatively, use a different screen locking program altogether - see [[List of applications/Security#Screen lockers]].}}
xscreensaver.demoCommand: xscreensaver-demo
+
  
! This is what the "Prefs" button on the splash screen runs (/bin/sh syntax.)
+
By default, XScreenSaver's ''New Login'' button in the lock screen will call {{ic|/usr/bin/gdmflexiserver}} to switch users. Other [[display manager]]s than [[GDM]] or [[KDM]] that support user switching (such as [[LightDM]]) require a different command.  
xscreensaver.prefsCommand: xscreensaver-demo -prefs
+
  
! This is the URL loaded by the "Help" button on the splash screen,
+
As modifications in {{ic|~/.xscreensaver}} are [[#Configuration|discarded]] by ''xscreensaver-demo'', {{ic|~/.Xresources}} is used in this section.
! and by the "Documentation" menu item in xscreensaver-demo.
+
xscreensaver.helpURL: http://www.jwz.org/xscreensaver/man.html
+
  
! loadURL      -- how the "Help" buttons load the helpURL (/bin/sh syntax.)
+
==== LXDM ====
xscreensaver.loadURL: firefox '%s' || mozilla '%s' || netscape '%s'
+
  
! manualCommand -- how the "Documentation" buttons display man pages.
+
To use LXDM's switching mode:
xscreensaver.manualCommand: xterm -sb -fg black -bg gray75 -T '%s manual' -e /bin/sh -c 'man "%s" ; read foo'
+
  
! The format used for printing the date and time in the password dialog box
+
  xscreensaver.newLoginCommand: lxdm -c USER_SWITCH
! To show the time only: %I:%M %p
+
! For 24 hour time: %H:%M
+
xscreensaver.dateFormat: %d-%b-%y (%a); %I:%M %p
+
  
! This command is executed by the "New Login" button on the lock dialog.
+
==== LightDM ====
! (That button does not appear on the dialog if this program does not exist.)
+
! For Gnome: probably "gdmflexiserver -ls".  KDE, probably "kdmctl reserve".
+
! Or maybe yet another wheel-reinvention, "lxdm -c USER_SWITCH".
+
xscreensaver.newLoginCommand: kdmctl reserve
+
xscreensaver.installColormap: True
+
xscreensaver.pointerPollTime: 0:00:05
+
xscreensaver.pointerHysteresis: 10
+
xscreensaver.initialDelay: 0:00:00
+
xscreensaver.windowCreationTimeout: 0:00:30
+
xscreensaver.bourneShell: /bin/sh
+
  
! Resources for the password and splash-screen dialog boxes of
+
To use [[LightDM]]'s switching mode:
! the "xscreensaver" daemon.
+
xscreensaver.Dialog.headingFont: *-helvetica-bold-r-*-*-*-180-*-*-*-iso8859-1
+
xscreensaver.Dialog.bodyFont: *-helvetica-bold-r-*-*-*-140-*-*-*-iso8859-1
+
xscreensaver.Dialog.labelFont: *-helvetica-bold-r-*-*-*-140-*-*-*-iso8859-1
+
xscreensaver.Dialog.unameFont: *-helvetica-bold-r-*-*-*-120-*-*-*-iso8859-1
+
xscreensaver.Dialog.buttonFont: *-helvetica-bold-r-*-*-*-140-*-*-*-iso8859-1
+
xscreensaver.Dialog.dateFont: *-helvetica-medium-r-*-*-*-80-*-*-*-iso8859-1
+
  
! Helvetica asterisks look terrible.
+
xscreensaver.newLoginCommand: dm-tool switch-to-greeter
xscreensaver.passwd.passwdFont: *-courier-medium-r-*-*-*-140-*-*-*-iso8859-1
+
  
 +
{{Note|If you use this to switch to an already-logged-in user, you might have to enter the password twice (once for LightDM, and once for the XScreenSaver dialog of the user you logged in to).}}
  
xscreensaver.Dialog.foreground: #000000
+
==== KDM ====
xscreensaver.Dialog.background: #E6E6E6
+
xscreensaver.Dialog.Button.foreground: #000000
+
xscreensaver.Dialog.Button.background: #F5F5F5
+
  
!*Dialog.Button.pointBackground: #EAEAEA
+
To use [[KDM]]'s switching mode:
!*Dialog.Button.clickBackground: #C3C3C3
+
xscreensaver.Dialog.text.foreground: #000000
+
xscreensaver.Dialog.text.background: #FFFFFF
+
xscreensaver.passwd.thermometer.foreground: #4464AC
+
xscreensaver.passwd.thermometer.background: #FFFFFF
+
xscreensaver.Dialog.topShadowColor: #FFFFFF
+
xscreensaver.Dialog.bottomShadowColor: #CECECE
+
xscreensaver.Dialog.logo.width: 210
+
xscreensaver.Dialog.logo.height: 210
+
xscreensaver.Dialog.internalBorderWidth: 24
+
xscreensaver.Dialog.borderWidth: 1
+
xscreensaver.Dialog.shadowThickness: 2
+
  
xscreensaver.passwd.heading.label: XScreenSaver %s
+
xscreensaver.newLoginCommand: kdmctl reserve
xscreensaver.passwd.body.label: This screen is locked.
+
xscreensaver.passwd.unlock.label: OK
+
xscreensaver.passwd.login.label: New Login
+
xscreensaver.passwd.user.label: Username:
+
xscreensaver.passwd.thermometer.width: 8
+
xscreensaver.passwd.asterisks: True
+
xscreensaver.passwd.uname: True
+
  
xscreensaver.splash.heading.label: XScreenSaver %s
+
== Tips and tricks ==
xscreensaver.splash.body.label: Copyright © 1991-2013 by
+
=== Disable during media playback ===
xscreensaver.splash.body2.label: Jamie Zawinski <jwz@jwz.org>
+
xscreensaver.splash.demo.label: Settings
+
xscreensaver.splash.help.label: Help</nowiki>}}
+
  
==Starting XScreenSaver==
+
==== mplayer/mpv ====
  
=== Single-User Systems ===
+
Add the following to {{ic|~/.mplayer/config}} or {{ic|~/.mpv/config}}:
Simply [[pacman|installing]] the {{Pkg|xscreensaver}} package is not enough to have it run automatically. The {{ic|xscreensaver}} program has to be started, which is commonly done by the desktop environment via a line in {{ic|~/.xinitrc}} as follows:
+
/usr/bin/xscreensaver -no-splash &
+
or
+
( ( sleep 10 && /usr/bin/xscreensaver -no-splash -display :0.0 ) & )
+
  
The ampersand {{ic|&}} argument makes the {{ic|xscreensaver}} program run in the background and is required.
+
heartbeat-cmd="xscreensaver-command -deactivate >&- 2>&- &"
  
XScreenSaver is automatically started by [[Xfce]] in {{ic|/etc/xdg/xfce4/xinitrc}}, to ensure it gets executed use {{ic|startxfce4}} and not {{ic|xfce4-session}}.
+
==== Kodi ====
exec startxfce4
+
  
=== Multi-User Systems ===
+
[[Kodi]] has no native support to disable XScreenSaver (it uses its own screensaver). [[Install]] the {{AUR|kodi-prevent-xscreensaver}} package as a workaround.
  
If operating with multiple users with a [[Display Manager|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 {{Pkg|gnome-screensaver}} and {{Pkg|xscreensaver}} but only have {{ic|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.
+
==== Flash ====
  
{{Note|Some XScreenSaver native functionality will be lost such as the ability to capture a screen, use photos in a pre-defined path, and/or display custom texts when running the DM's native screensaver with a subset of XScreenSaver's offerings (for example, Flipscreen3D, photopile, etc.)}}
+
There is no native way to disable XScreenSaver for [[Flash]], but there is script named [https://github.com/kodx/lightsOn lightsOn] with support for Firefox's Flash plugin, Chromium's Flash plugin, MPlayer, and VLC.
  
Another option to retain multi-user support, without having to install a second screensaver, is to modify either {{ic|~/.xscreensaver}} for per-user settings, or {{ic|/usr/share/X11/app-defaults/XScreenSaver}} for global settings, and add the following line.
+
=== Animated wallpaper ===
{{bc|newLoginCommand: /usr/bin/gdmflexiserver}}
+
{{Note|The command given is for [[GDM]]; if you are using a different login manager, you will need to replace it with your preferred login manager's command.}}
+
  
==Lock Screen==
+
One can run {{ic|xscreensaver}} in the background, just like a wallpaper. First, kill any process that is controlling the background (the root window).
You may immediately trigger {{ic|xscreensaver}}, if it is running, and lock the screen with the following command:
+
$ xscreensaver-command --lock
+
  
=== Automatically lock when suspending/sleeping/hibernating ===
+
Then, locate the desired XScreenSaver executable (typically in {{ic|/usr/lib/xscreensaver/}}) and run it with the {{ic|-root}} flag, for example:
  
Install {{AUR|xuserrun-git}} from [[AUR]], and create the following file:
 
 
{{hc|/etc/systemd/system/xscreensaver.service|<nowiki>
 
[Unit]
 
Description=Lock X session using xscreensaver
 
Before=sleep.target
 
 
[Service]
 
Type=oneshot
 
ExecStart=/usr/bin/xuserrun /usr/bin/xscreensaver-command -lock
 
 
[Install]
 
WantedBy=sleep.target
 
</nowiki>}}
 
 
and enable it with
 
# systemctl enable xscreensaver
 
 
You may want to set XScreenSaver's fade out time to 0.
 
 
Other service configuration without xuserrun and for one user from [https://bbs.archlinux.org/viewtopic.php?id=163281 this thread], replace the previous <nowiki>[Service]</nowiki> section by this one :
 
 
{{hc|/etc/systemd/system/xscreensaver.service|<nowiki>
 
[Service]
 
User=yourusername
 
Type=oneshot
 
Environment=DISPLAY=:0
 
ExecStart=/usr/bin/screensaver-command -lock
 
</nowiki>}}
 
 
Another option, is to install {{AUR|xss-lock}} from [[AUR]], and run this command at your system startup:
 
$ xss-lock -- xscreensaver-command -lock &
 
 
You can also add it to your autostart script.
 
 
==Disabling XScreenSaver for Media Applications==
 
===MPlayer===
 
Add the following to {{ic|~/.mplayer/config}}
 
heartbeat-cmd="xscreensaver-command -deactivate >&- 2>&- &"
 
 
===XBMC===
 
There is no native support within XBMC to disable XScreenSaver (although XBMC does come with its own screensaver). The [[Arch User Repository|AUR]] contains a tiny app called {{AUR|xbmc_prevent_xscreensaver}} does just this.
 
 
===Adobe Flash/MPlayer/VLC===
 
There is no native way to disable XScreenSaver for flash, but there is script named [https://github.com/iye/lightsOn 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 {{ic|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 {{ic|/usr/lib/xscreensaver/}}) and run it with the {{ic|-root}} flag, like this
 
 
  $ /usr/lib/xscreensaver/glslideshow -root &
 
  $ /usr/lib/xscreensaver/glslideshow -root &
  
===XScreenSaver as wallpaper under xcompmgr===
+
{{Note|If [[xcompmgr]] causes problems, [[install]] the {{AUR|shantz-xwinwrap-bzr}} package, and run:
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|shantz-xwinwrap-bzr}} in the [[Arch User Repository|AUR]].
+
  
Run it with the following command:
 
 
  $ xwinwrap -b -fs -sp -fs -nf -ov  -- /usr/lib/xscreensaver/glslideshow -root -window-id WID &
 
  $ xwinwrap -b -fs -sp -fs -nf -ov  -- /usr/lib/xscreensaver/glslideshow -root -window-id WID &
 
==Theming==
 
XScreenSaver's unlock screen can be themed with [[X resources]] (see: [[X resources#XScreenSaver_resources|XScreenSaver resources]]).
 
 
== User switching from the lock screen ==
 
By default, xscreensaver's "New Login" button in the lock screen will call {{ic|/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.
 
 
{{Note|Modifications manually made to {{ic|~/.xscreensaver}} are discarded by xscreensaver-demo, therefore you should probably use instead {{ic|~/.Xresources}}. For example, for LXDM, add in {{ic|~/.Xresources}}:
 
xscreensaver.newLoginCommand: lxdm -c USER_SWITCH
 
 
}}
 
}}
  
=== LXDM ===
+
== Troubleshooting ==
Simply paste the following into {{ic|~/.xscreensaver}} to use LXDM's switching mode:
+
 
+
newLoginCommand: lxdm -c USER_SWITCH
+
 
+
=== Lightdm ===
+
Simply paste the following into {{ic|~/.xscreensaver}} to use lightdm's switching mode:
+
 
+
newLoginCommand: dm-tool switch-to-greeter
+
 
+
=== KDM ===
+
Simply paste the following into {{ic|~/.xscreensaver}} / {{ic|/usr/share/X11/app-defaults/XScreenSaver}} to use kdm's switching mode:
+
 
+
newLoginCommand: kdmctl reserve
+
 
+
=== SLIM ===
+
?
+
  
==Debugging==
 
 
You can configure xscreensaver to write to a log file by creating the logfile {{ic|# touch /var/log/xscreensaver.log}} and then specifying its X resource ''logFile''.
 
You can configure xscreensaver to write to a log file by creating the logfile {{ic|# touch /var/log/xscreensaver.log}} and then specifying its X resource ''logFile''.
 
{{hc|~/.Xresources|xscreensaver.logFile:/var/log/xscreensaver.log}}
 
{{hc|~/.Xresources|xscreensaver.logFile:/var/log/xscreensaver.log}}
  
To log verbose debugging information to the logFile as well start xscreensaver with the {{ic|-verbose}} command line option, or add this to your {{ic|~/.Xresources}}
+
To log verbose debugging information to the logFile as well start xscreensaver with the {{ic|-verbose}} command line option, or add this to {{ic|~/.Xresources}}
 
{{hc|~/.Xresources|<nowiki>xscreensaver.logFile:/var/log/xscreensaver.log
 
{{hc|~/.Xresources|<nowiki>xscreensaver.logFile:/var/log/xscreensaver.log
 
xscreensaver.verbose:true</nowiki>}}
 
xscreensaver.verbose:true</nowiki>}}
  
 +
== See also ==
  
==See Also==
 
* [http://wiki.gotux.net/downloads/paniclock PanicLock] -- Lock your screen and close any selected programs in background.
 
 
* [http://www.jwz.org/xscreensaver/ Homepage for XScreenSaver]
 
* [http://www.jwz.org/xscreensaver/ Homepage for XScreenSaver]
* [[Display Power Management Signaling]]
 
* [[xinitrc]]
 

Latest revision as of 21:24, 26 May 2016

XScreenSaver is a screen saver and locker for the X Window System.

Installation

Install the xscreensaver package.

For an Arch Linux branded experience, install the xscreensaver-arch-logoAUR package.

Configuration

Most options are configured on a user-by-user basis by running xscreensaver-demo. xscreensaver-demo writes the chosen configuration to ~/.xscreensaver, discarding any manual modifications to the file. Global options are defined in /usr/share/X11/app-defaults/XScreenSaver.

Since at least XScreenSaver 5.22, there is another way to edit XScreenSaver's user configuration, using Xresources. This includes theming support. See [1] for the version 5.22 defaults.

DPMS and blanking settings

Tango-edit-clear.pngThis article or section needs language, wiki syntax or style improvements.Tango-edit-clear.png

Reason: "overrides DPMS" is vague - xscreensaver does the equivalent of xset s 0 0, uses its own timer for the various animations, but sets the DPMS timeout to the values in Display Power Management (Discuss in Talk:XScreenSaver#)

XScreenSaver manages screen blanking and display energy saving (DPMS) independently of X itself and overrides it. To configure the timings for blanking, standby, display poweroff and such, use xscreensaver-demo or edit the configuration file manually, e.g. ~/.xscreensaver:

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

DPMS and screen blanking can be disabled by starting xscreensaver-demo and, for the Mode setting, choosing Disable Screen Saver.

Note: If Lock Screen After in xscreensaver-demo is ticked and set to 0 minutes, the screen will be locked immediately upon blanking. If Power Manager Enabled is unticked, DPMS is disabled; it does not mean that XScreenSaver will relinquish control of DPMS settings.

Usage

Tip: To start XScreenSaver without the splash screen, use the -no-splash switch. See man xscreensaver for a full list of options.

In the Xfce, LXDE and LXQt environments, XScreenSaver is autostarted automatically if it is available - no further action is required. For other environments, see Autostarting.

To immediately trigger xscreensaver, if it is running, and lock the screen, execute the following command:

$ xscreensaver-command --lock

Lock on suspend

See Power management#xss-lock. You may want to set XScreenSaver's fade out time to 0.

User switching from the lock screen

Warning: When switching users using a display manager such as GDM or LightDM, XScreenSaver will not lock the original session - it can be accessed without a password simply by switching TTY's to the session in question. If you are using LightDM, as a workaround, install light-locker and run it alongside XscreenSaver. Alternatively, use a different screen locking program altogether - see List of applications/Security#Screen lockers.

By default, XScreenSaver's New Login button in the lock screen will call /usr/bin/gdmflexiserver to switch users. Other display managers than GDM or KDM that support user switching (such as LightDM) require a different command.

As modifications in ~/.xscreensaver are discarded by xscreensaver-demo, ~/.Xresources is used in this section.

LXDM

To use LXDM's switching mode:

xscreensaver.newLoginCommand: lxdm -c USER_SWITCH

LightDM

To use LightDM's switching mode:

xscreensaver.newLoginCommand: dm-tool switch-to-greeter
Note: If you use this to switch to an already-logged-in user, you might have to enter the password twice (once for LightDM, and once for the XScreenSaver dialog of the user you logged in to).

KDM

To use KDM's switching mode:

xscreensaver.newLoginCommand: kdmctl reserve

Tips and tricks

Disable during media playback

mplayer/mpv

Add the following to ~/.mplayer/config or ~/.mpv/config:

heartbeat-cmd="xscreensaver-command -deactivate >&- 2>&- &"

Kodi

Kodi has no native support to disable XScreenSaver (it uses its own screensaver). Install the kodi-prevent-xscreensaverAUR package as a workaround.

Flash

There is no native way to disable XScreenSaver for Flash, but there is script named lightsOn with support for Firefox's Flash plugin, Chromium's Flash plugin, MPlayer, and VLC.

Animated wallpaper

One can run xscreensaver in the background, just like a wallpaper. First, kill any process that is controlling the background (the root window).

Then, locate the desired XScreenSaver executable (typically in /usr/lib/xscreensaver/) and run it with the -root flag, for example:

$ /usr/lib/xscreensaver/glslideshow -root &
Note: If xcompmgr causes problems, install the shantz-xwinwrap-bzrAUR package, and run:
$ xwinwrap -b -fs -sp -fs -nf -ov  -- /usr/lib/xscreensaver/glslideshow -root -window-id WID &

Troubleshooting

You can configure xscreensaver to write to a log file by creating the logfile # touch /var/log/xscreensaver.log and then specifying its X resource logFile.

~/.Xresources
xscreensaver.logFile:/var/log/xscreensaver.log

To log verbose debugging information to the logFile as well start xscreensaver with the -verbose command line option, or add this to ~/.Xresources

~/.Xresources
xscreensaver.logFile:/var/log/xscreensaver.log
xscreensaver.verbose:true

See also