💾 Archived View for thrig.me › tech › openbsd › desktop.gmi captured on 2024-08-18 at 18:33:58. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2024-02-05)

-=-=-=-=-=-=-

OpenBSD Desktop

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.

four-terminals-and-mupdf.png

Input

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 actually owned and used a SmartPhone 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
    doas wsconsctl mouse.tp.disable | grep -q =0
    if [ $? -eq 0 ]; then
            doas wsconsctl mouse.tp.disable=1 2>/dev/null
    else
            doas wsconsctl mouse.tp.disable=0 2>/dev/null
    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 actually use one of those "heavyweight champion" browsers with any regularity, you'll probably want to set everything else to use CLIPBOARD; for some reason the bloat browsers default to CLIPBOARD while, like, everything else uses PRIMARY. 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

for the rare occasions when something in the clipboard does need to be lobbed over to a bloat browser.

X11 Configuration

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, so this brutality is perhaps excusable. The exec is to avoid having a shell script dangling around in memory.

    export LC_CTYPE=en_US.UTF-8
    /usr/X11R6/bin/setxkbmap -option caps:escape
    /usr/X11R6/bin/xset r rate 300 200
    /usr/bin/doas /usr/bin/mixerctl outputs.master=150,150 outputs.hp_boost=on >/dev/null
    /usr/X11R6/bin/xbacklight -steps 1 -set 42
    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 disable the dbus. If something requires dbus I figure it ain't written aright.

    doas chmod -x /usr/local/bin/dbus-{launch,daemon}

More Code

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