
xset: Basic Usage for X
xset: Basic Usage for X
xset is a lightweight utility to customize user preferences for the X server. It changes settings such as screensaver behavior, bell sounds, and DPMS energy features. If you’re new to X or coming from a purely terminal mindset, this tool is one of the first things to tweak for a nicer desktop experience.
Quick start: common tasks
- Disable the screensaver
xset s off
- Disable the bell sound
xset b off
- Set the screensaver to start after 60 minutes of inactivity
xset s 3600 3600
- Disable DPMS (Energy Star) features
xset -dpms
- Enable DPMS (Energy Star) features
xset +dpms
- Query information on any X server (example shows a specific display)
xset -display :0 q
Note: The display value (:0, :1, etc.) depends on your system. If you don’t specify a display, xset uses the current X session.
How to use xset effectively
-
Persisting settings: xset changes are runtime-only. If you reboot or log out, you may lose settings unless your session manager or startup scripts reapply them. Consider placing commands in your X startup script or desktop environment autostart.
-
When to tinker with DPMS: DPMS controls power-saving features for monitors. Disabling DPMS can keep the monitor on, but may waste energy. If you’re on a laptop, enabling DPMS helps save battery.
-
Screensaver vs. blanking: The s parameter controls both the timeout and the blanking behavior. The examples use s 3600 3600, which means 3600 seconds for the timeout and 3600 seconds for the stalled blanking interval. If you only pass one value (e.g., xset s 0), you’re adjusting only the timeout or turning it off depending on syntax.
Common pitfalls
- No X server running: If you run xset from a non-X terminal, you’ll get an error because there’s no X server to talk to. Make sure you’re in an X session or set a display:
export DISPLAY=:0
xset -q
-
Permissions and multi-user environments: Some xset settings are per-user. Other users may have their own X server instance. Avoid assuming a global effect.
-
Different desktop environments may override: Some environments restore settings on startup or per-session. If you’re not seeing changes persist, check startup applications or session settings.
Quick reference cheat sheet
- Disable screensaver:
xset s off
- Disable beep on timeout:
xset -b
orxset b off
- Set screensaver timeout to 1 hour:
xset s 3600 3600
- Disable DPMS:
xset -dpms
- Enable DPMS:
xset +dpms
- Query X server info:
xset q
orxset -display :0 q
When to consult the manual
If you need fine-grained control or see unexpected behavior, consult the man page or online docs:
- man xset
- https://manned.org/xset
In practice, start with a few simple changes, verify they work in your session, and then decide if you want to automate them on startup for a smoother daily experience.