The wscons(4)
hardware-independent console driver lets you configure your boring, black-and-white, nongraphical console in many ways.
Start by viewing the current console settings using wsconsctl(8)
. Run the following on a text console, not in an X session (changes made in wscons
can carry over to an X session, but once you start X, you’re mostly stuck with X’s configuration system).
$ wsconsctl
keyboard.type=pc-xt
keyboard.bell.pitch=400
keyboard.bell.period=100
keyboard.bell.volume=50
…
Each line contains a system variable and a setting, many of which you can change. The keyboard.type
variable represents the type of keyboard on the system. Because this is an amd64 system, it uses the pc-xt
keyboard common to consumer computers, but you’ll see different keyboard types with different hardware.
You can also change these settings with wsconsctl
. For example, in the previous listing, the variable keyboard.bell.volume
sets the volume of the computer’s beep. Now, I’m a tcsh
user, and I frequently use tab completion (type a character or two, press TAB, and the shell fills in the name of the command or file you’re about to type). Unfortunately, when tab completion hits an ambiguous spot, it stops. That’s not a problem when I’m logged in over SSH, because I can just type a character or two and press TAB again. But when I’m on the local console, each ambiguity is accompanied by a beep (or bell) from the computer. When I’m trying to fix a problem, and the bell rings, shouting “beep WRONG! beep WRONG! beep WRONG!” I have only one thought:
The beep must die.
$ wsconsctl keyboard.bell.volume=0
keyboard.bell.volume=0
Now silence reigns and I can resolve the problem without the computer nagging me. (You could choose to turn up the volume, if you’re a masochist. I won’t judge you—at least not in public.)
Here, we’ll look at a couple other things you can do with wscons
.
If you leave the system alone for a few minutes, the screen should go blank to reduce power usage. Modern monitors often do this on their own, but you can also configure this behavior in the operating system, especially for older platforms. OpenBSD turns off the display only once it knows how to reactivate the display.
display.kbdact
. Wake on keyboard activity
display.msact
. Wake on mouse activity
display.outact
. Wake on monitor output
Set one of these wscons
variables to on
, and OpenBSD will realize it should start blanking the monitor after the idle timeout. The variable display.screen_off
gives the idle timeout in milliseconds; the default, 600000
, is 10 minutes.
You can also choose between turning the screen black and putting the monitor into “power-saver” mode, also known as sleep. A monitor showing a black screen reactivates immediately when triggered, but uses more power. A sleeping monitor really is off, and needs a few seconds to reactivate. To set power-saver mode, change the variable display.vblank
to on
. (Some old monitors don’t believe in saving power, so this won’t work on them.)
Users can adjust console settings, but those settings will disappear at the next reboot. To set wscons
variables at boot, add them to /etc/wsconsctl.conf. The boot process reads this file and applies any variables it finds to the console.