First, make sure you belong to the class (not group) staff:
# user mod -L staff pau
Then give a bit more of RAM to programs
# Staff have fewer restrictions and can login even when nologins are set.
Allow mic and camera to record
The mic has been disabled from 6.2 (https://www.zdnet.com/article/audio-recording-is-now-disabled-by-default-in-openbsd/).
To get it back, simply run
# echo kern.audio.record=1 >> /etc/sysctl.conf # set at boot
The camera requires the same since 2021,
# echo sysctl kern.video.record=1 >> /etc/sysctl.conf # set at boot
Secure screen after suspending
Use xdm: Since you do not want to leave a terminal open, do not start X with startx. This would leave open that terminal and launch X on another one. Since you are using xdm, you need a .xsession file instead of a .xinitrc. My .xsession file looks like
xmodmap -e "keycode 22 = BackSpace BackSpace BackSpace BackSpace BackSpace BackSpace"
xidle -delay 5 -sw -program "/usr/X11R6/bin/xlock -mode blank" -timeout 90 &
qiv -zr $HOME/escriptori/Galicia/*
cwm -c /home/pau/fitx_confg/cwm/cwmrc
The first line cancels the function Zap of X, which means that nobody can interrupt your X session by pressing CTRL+Alt+Backspace. xidle is necessary to launch the screensaver via xlock
Create /etc/apm/suspend and make it executable:
$ cat /etc/apm/suspend
pkill -USR1 xidle
Make sure apm is running everytime after boot. If it is not, while your laptop will suspend, the script suspend will not be executed, and the screen will not be locked. To test if apmd is running, type zzz from the terminal. A message like zzz: cannot connect to apmd: No such file or directory Will tell you that your apmd is NOT running.
To have apmd run after boot, add a flag to rc.conf.local:
$ cat /etc/rc.conf.local
apmd_flags="-A -z 15"
Check your battery
The bits in rc.conf.local we described above
apmd_flags="-A -z 15"
will force your laptop to suspend when only 15% of the battery is left. If you prefer to hibernate it, choose Z instead. Check
You can for instance change the background by adding an image and using qiv. For this, make a directory to store background images, e.g.
/usr/local/share/backgrounds/pau and add images there. Then
# vim /etc/X11/xenodm/Xsetup_0
And change the console line to
#xconsole -geometry 480x130-0-0 -daemon -notify -verbose -fn fixed -exitOnFail
/usr/local/bin/qiv -zr /usr/local/share/backgrounds/pau/*
Set these two options: