LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

xscreensaver-command

Control running xscreensaver daemon

TLDR

Activate screensaver immediately
$ xscreensaver-command -activate
copy
Lock screen
$ xscreensaver-command -lock
copy
Deactivate screensaver
$ xscreensaver-command -deactivate
copy
Restart screensaver daemon
$ xscreensaver-command -restart
copy
Exit screensaver daemon
$ xscreensaver-command -exit
copy
Show current status
$ xscreensaver-command -time
copy
Watch for state changes
$ xscreensaver-command -watch
copy

SYNOPSIS

xscreensaver-command [options]

DESCRIPTION

xscreensaver-command controls a running xscreensaver daemon by sending client messages. It can activate, deactivate, or lock the screen, cycle through display modes, and query status.The -watch option streams state changes, useful for scripts that need to react to screensaver events. The -deactivate option can be called periodically to prevent screen blanking during video playback.Configuration is done through xscreensaver-settings, which writes preferences to ~/.xscreensaver.

PARAMETERS

-activate

Blank screen immediately.
-deactivate
Simulate user activity; unblank screen.
-lock
Lock screen immediately.
-cycle
Switch to next screensaver hack.
-next / -prev
Switch to next/previous hack.
-select n
Switch to hack number n.
-restart
Restart the daemon with same arguments.
-exit
Exit daemon (fails if locked).
-time
Show last activation/deactivation time.
-watch
Print state changes continuously.
-version
Print the version of the running xscreensaver daemon.
-quiet
Print output only if an error occurs.
-verbose
Print verbose output (default).

INSTALL

sudo apt install xscreensaver
copy
sudo dnf install xscreensaver
copy
sudo pacman -S xscreensaver
copy
sudo apk add xscreensaver
copy
sudo zypper install xscreensaver
copy
nix profile install nixpkgs#xscreensaver
copy

CAVEATS

Requires xscreensaver daemon running. Never use kill -9 while screensaver is active. The -exit command fails if screen is locked. X11 only.

HISTORY

xscreensaver was created by Jamie Zawinski in 1992 and has been the most popular X11 screensaver framework for decades. The modular design separates the daemon, display hacks, and control interface, allowing extensive customization and third-party hack development.

SEE ALSO

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid