HOWTO turn Screensavers and Monitor Power Saving on and off

From LinuxReviews
Jump to navigationJump to search

Screensavers or power saving activating when you don't want it to, or not activating when you want, can be annoying. Here's how you configure it the way you like

Disabling screen blanking in text consoles (the "virtual terminal")[edit]

Use setterm[1] to disable screen blanking in the text console, type:

Shell command(s):
setterm -blank 0

To make this setting permanent, just add it to your session script(s).

Controlling screenblanking / powersaving in X[edit]

Screen blanking and power saving is controlled by the xset command in X.

To view your current settings:

Shell command(s):
xset -q

The s option lets you set the screen saver parameters. This option accepts up to two numerical parameters, a 'blank/noblank' flag, an 'expose/noexpose' flag, an 'on/off' flag, an 'activate/reset' flag, or the 'default' flag.

To turn off screen blanking:

Shell command(s):
xset s off

If the X screensaver has blanked the screen on a box without keyboard you can remotely login, then turn off the screensaver and activate the screen with the commands:

export DISPLAY=localhost:0.0
xset s activate
xset s off

Use xset[2] +dpms and -dpms to enable/disable DPMS (Energy Star) features (power saving).

Shell command(s):
xset +dpms
Shell command(s):
xset -dpms

You can find more information about xset on the xset manual page.

xscreensaver[edit]

xscreensaver is a common screen saver program for X. This is used by common window managers. You can add xscreensaver & to your ~/.xinitrc. if you want it to be started when you login.

You can check if xscreensaver is running with the commands pgrep xscreensaver and ps -aux | grep xscreens.

You can use it to lock your screen with

Shell command(s):
xscreensaver-command -lock

xscreensaver can be stopped and terminated with

Shell command(s):
xscreensaver-command -exit

kde[edit]

The settings for KDEs screen saver are found in the KDE Control Center (systemsettings5)

References[edit]