The keyboard repeats too fast, the pointer is twitchy, or the screen blanks mid-presentation: xset fixes any of it without a reboot or a config file. This guide covers inspecting an X display, making a temporary keyboard or pointer adjustment, and putting it back to the server defaults when you are done. The examples target xset 1.2.5 from Debian package x11-xserver-utils version 7.7+10build2.
Allow about ten minutes. You need an X session and a shell running with access to that session. These settings belong to the X server and normally reset when you log out. They are not a replacement for persistent desktop settings, and they do not apply to Wayland clients.
Start with a read-only version check. It needs no sudo and makes no graphical change:
$ xset -version
1.2.5
Then ask the X server for its current settings:
$ xset q
Keyboard Control:
auto repeat: on key click percent: 0 LED mask: 00000000
auto repeat delay: 660 repeat rate: 25
...
The exact report depends on your server and hardware. The useful checkpoint is that xset q completes and prints sections such as Keyboard Control, Pointer Control and Screen Saver. If it says it cannot open the display, stay in the same graphical session, or set the correct display explicitly:
$ xset -display :0 q
Do not guess a display number on a multi-user host. Use the display value supplied by your own session, and do not copy another user's DISPLAY or authentication details.
The mouse option, abbreviated to m, sets acceleration and threshold for every connected pointing device. A simple integer or fraction is the acceleration; the second number is the threshold in mickeys. This example uses a moderate acceleration and a zero threshold:
$ xset mouse 2/1 0
$ xset q | sed -n '/Pointer Control:/,/Screen Saver:/p'
With a zero threshold, the server switches to the more continuous acceleration formula described in the manual. The result is server-specific, so treat the query output as your verification rather than expecting one universal line to appear.
This affects every connected pointing device exposed through the X server: it is not a per-device setting. If you need separate touchpad and mouse behaviour, reach for xinput instead.
Recovery: Return the pointer to the server defaults with:
$ xset mouse default
Use r to control keyboard autorepeat. The two numbers for rate are the delay before repeating starts, in milliseconds, and the repeat rate, in repeats per second when the server uses XKB:
$ xset r rate 500 30
$ xset q | sed -n '/Keyboard Control:/,/Pointer Control:/p'
If the server lacks the required extension, it may reject the rate request or interpret it differently. Read the error and check the resulting report; do not assume a command accepted by the shell was accepted by the server.
For a single key, supply its keycode. The manual documents this form:
$ xset -r 10
That disables autorepeat for keycode 10 only, and it will not necessarily land on the same printed key across every keyboard layout. Re-enable it with xset r 10. To restore the general default rate, omit the numeric values entirely:
$ xset r rate
The b option controls bell volume, pitch in hertz and duration in milliseconds. Hardware may round or simply ignore some values:
$ xset b 40 800 80
To turn the bell off temporarily, use xset b off; restore the server defaults with xset b alone. The c option works the same way for key click volume, from 0 to 100:
$ xset c 20
$ xset c
These are session-level changes. If a desktop environment keeps reapplying its own keyboard profile, it may overwrite them later, which is a configuration conflict rather than evidence that your syntax was wrong.
The s option takes a blanking length and a pattern-change period, both in seconds. This example starts screen saving after five minutes and changes its pattern every ten minutes:
$ xset s 300 600
$ xset q | sed -n '/Screen Saver:/,/Font Path:/p'
Use s off to disable the screen saver functions, or s on to switch them back on. These options concern the X server's own screen saver, not necessarily your desktop environment's lock policy. Do not call an enabled screen saver a security control unless you have separately confirmed that your session locks.
Warning: xset s activate forces activation immediately, and xset s reset cancels an active saver. Either can disrupt an unattended display, so use them only when that effect is exactly what you want.
Restore the screen saver defaults with:
$ xset s default
xset can also enable or disable DPMS, force the display to standby, suspend or off, and replace or edit the X server font path. Those operations affect the display or how clients find fonts, so avoid testing them in a shared or production session without recording the current xset q output and agreeing a recovery step first.
In particular, xset dpms force off blanks the display immediately: it is not a harmless status check. Font-path changes can also make applications fail to find fonts until you run xset fp default or restore the previous path. No elevated privilege is normally required here, but access to the X display is.
xset -version identified the installed 1.2.5 command, and xset q reached the intended X display.