Name

xdg-screensaver — command line tool for controlling the screensaver

Synopsis

xdg-screensaver suspend WindowID

xdg-screensaver restore WindowID

xdg-screensaver { activate | reset | status }

xdg-screensaver { --help | --manual | --version }

Description

xdg-screensaver provides commands to control the screensaver.

xdg-screensaver is for use inside a desktop session only. It is not recommended to use xdg-screensaver as root.

Commands

suspend WindowID

Suspends the screensaver and monitor power management. WindowID must be the X Window ID of an existing window of the calling application. The window must remain in existance for the duration of the suspension.

The screensaver can be suspended in relation to multiple windows at the same time. In that case screensaver operation is only restored once the suspensions have been restored in relation to each of the windows

resume WindowID
Resume the screensaver and monitor power management after being suspended. WindowID must be the same X Window ID that was passed to a previous call of xdg-screensaver suspend
activate
Turns the screensaver on immediately. This may result in the screen getting locked, depending on existing system policies.
reset
Turns the screensaver off immediately. This my result in a password prompt to unlock the screen, depending on existing system policies.
status
Returns true if the screensaver is enabled to turn on after a period of inactivty, or false otherwise.

Options

--help
Show command synopsis.
--manual
Show this manualpage.
--version
Show the xdg-utils version information.

Exit Codes

An exit code of 0 indicates success while a non-zero exit code indicates failure. The following failure codes can be returned:

1
Error in command line syntax.
2
One of the files passed on the command line did not exist.
3
A required tool could not be found.
4
The action failed.

Examples

xdg-screensaver suspend 0x1c00007

Causes the screensaver to be disabled till xdg-screensaver resume 0x1c00007 is called. 0x1c00007 must be the X Window ID of an existing window.

Bugss

There is no provision for cancelling a suspend operation. If a second suspend is started before the first one is completed, then the screensaver will be restored to its original state before the second suspend is able to complete.

For example, if a presenter completes her presentation, and a second presenter starts before the delay is over, then the screensaver could come on during the second presentation.

True suspend functionality will require cooperation from the X server. The Xorg group has implemented an extension that allows an application to disable the screensaver while it is connected, which will re-enable the screensaver. xdg-screensaver should be updated to take advantage of this functionality when it is available.