💾 Archived View for thrig.me › tech › openbsd › desktop.gmi captured on 2023-06-14 at 15:24:01. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-04-26)
-=-=-=-=-=-=-
I've been using OpenBSD as a primary desktop for years now. The desktop is a pretty standard cwm setup, mostly running the usual four xterms. Sometimes I switch to fvwm, which is better for having PDFs up in one virtual desktop and flipping over to other virtual desktops, or for when there are lots of xterm groups to switch between. But for the laptops it's mostly all been cwm.
Some of the following configuration gets copied to
https://thrig.me/src/dotfiles.git
with no great regularity.
Disable touchpad tapping in /etc/wsconsctl.conf; my usual trackpad motions cause this to happen, a lot, which is super annoying. All that swiping stuff got disabled on Mac OS X, too. Maybe if I used SmartPhones those motions might make sense?
mouse.tp.tapping=0
Actually the mouse is disabled by default; I don't have much use for it, most of the time.
$ cat `which toggle-gnat` #!/bin/sh gnat=/dev/wsmouse xinput --list $gnat | grep -q disabled if [ $? -eq 0 ]; then xinput --enable $gnat else xinput --disable $gnat fi
Copy and paste is mostly done inside tmux(1),
set-window-option -g mode-keys vi bind-key c copy-mode bind-key v paste-buffer
and then to copy, say, (https://example.org) with your cursor somewhere past it, that would be prefix c ? https return space and then some selector to find the end of the URL, maybe $ return or t ) return if it's within parens. This is easier to do than to describe, with practice. And you'll probably want to pick one of emacs or vi mode and get really good at it everywhere. I also have a copycat(1) command to filter data into the X11 clipboard from vi or anywhere that can run a command.
xterm(1) probably needs different keys than shift+insert to paste, so I cargo culted the following from somewhere into ~/.Xdefaults. xsel or xclip are also good. My scripts look like they all use xsel, I forget which of those two was supposed to be better so have both installed.
#Ctrl Shift <Key>C: copy-selection(SELECT) \n\ *VT100*translations: #override \n\ !Ctrl <Btn1Down>:ignore() \n\ !Lock Ctrl <Btn1Down>:ignore() \n\ !Lock Ctrl @Num_Lock <Btn1Down>:ignore() \n\ ! @Num_Lock <Btn1Down>:ignore() \n\ Ctrl Shift <Key>V: insert-selection(SELECT) \n\ Ctrl Shift <Key>V: insert-selection(SELECT) \n\ <Key>Insert: insert-selection(SELECT) \n\ Alt <Key>V: insert-selection(SELECT)
If you use one of those "heavyweight champion" browsers, you'll probably want to use CLIPBOARD by default. I have some shell script wrappers that covert PRIMARY to CLIPBOARD or the other way around when that is needed, something like
xsel -l /dev/null -o -p | xsel -l /dev/null -i -b
With other passwords set, you can autologin to X11 to avoid having to type yet another password.
$ fgrep auto /etc/X11/xenodm/xenodm-config DisplayManager._0.autoLogin: yourloginnamehere
Otherwise in Xsetup_0 I usually disable the xconsole and maybe set a pretty background.
The ~/.xsession probably should call things like setxkbmap to disable capslock (or maybe to remap it to escape), though at one point I had simply removed the capslock key from the Dell keyboard at work. (There were piles of Dell keyboards in other rooms.) The exec is to avoid having a shell script dangling around in memory.
export LANG=en_US.UTF-8 export LC_CTYPE=en_US.UTF-8 # I have a custom software depot under ~/ so need that in PATH export PATH=... /usr/X11R6/bin/setxkbmap -option caps:escape /usr/X11R6/bin/xset r rate 300 200 /usr/bin/doas /usr/bin/mixerctl outputs.master=168,168 outputs.hp_boost=on >/dev/null /usr/local/bin/feh --no-fehbg --bg-tile "$HOME"/share/imgs/graph.png & # new in OpenBSD 7.2, support for xbacklight !! /usr/X11R6/bin/xbacklight -steps 1 -set 42 # TODO revisit xset s on +dpms and xidle exec /usr/X11R6/bin/cwm
Be sure to have a look at ~/.xsession-errors now and then, especially after upgrades, and especially after the audio system commands get changed, again.
I probably need to do more with ~/.cwmrc. There might be a better way then xdotool to summon a particular of the usual four terminals, and more might be done with autogroup or window groups in general.
autogroup 1 "cousterm" autogroup 2 "MuPDF" bind-key 4-1 "xdotool search --name votcana-pa windowactivate" bind-key 4-2 "xdotool search --name votcana-re windowactivate" bind-key 4-3 "xdotool search --name votcana-ci windowactivate" bind-key 4-4 "xdotool search --name votcana-vo windowactivate" command big /home/FIXME/libexec/cousterm command voctana /home/FIXME/libexec/votcana ignore xbattery ignore xclipboard ignore xeyes ignore xload wm fvwm /usr/X11R6/bin/fvwm
xwininfo and xprop show various window details that might be handy to know.
I usually disable the dbus. If something requires dbus I figure it isn't written right.
doas chmod -x /usr/local/bin/dbus-{launch,daemon}
There are some X11 related scripts under
https://thrig.me/src/scripts.git
though most of them probably are not very interesting. You'll probably also want some scripts to toggle mute and to change the volume, in the event those function keys do not work or are too long a reach from where your fingers are.
tags #openbsd