Getting Void Linux to work right

My experiment with Void Linux started very well. There was the usual round of installing all the packages I needed to make the computer useful, and then there was the business of getting nonfunctional stuff to work. Being that Void doesn’t modify packages, this was also an educational experience.

The trackpad

The trackpad on this computer was tracking too slowly for my liking. I don’t know if it was due to Arch/Void differences, or just changes in xorg, but it really doesn’t matter.

I didn’t want to fix this with an X configuration file, primarily because it doesn’t live in my home directory and is thus vulnerable to disappearing with an OS install.

I discovered xinput, which allows you to query and set various input-related settings in a running X server.

To get a list of input devices:

xinput

To see the available properties of a device (use the device name reported above):

xinput list-props <device name>

To set a property:

xinput set-prop "ETPS/2 Elantech Touchpad" 287 1

where “ETPS/2 Elantech Touchpad” is the device name, 287 is the number of the property to set, and 1 is the value I want there.

I run this in .xinitrc before starting xfce4.

X display settings

I discovered the wonders of xrandr some time ago, but it’s worth documenting. With a laptop, you (or at least I) frequently end up connecting to a variety of different screens. These are often TVs that just don’t correctly report their capabilities in the EDID (which is the way a monitor tells a computer its name, the resolutions it supports, etc).

To fix this, you can sometimes supply an EDID file to the kernel at boot, or edit the xorg configuration, or just use xrandr on a running X server.

To create a new mode, and assign it to a particular output use this:

xrandr --newmode "1920x1080 60Hz" 148.500MHz 1920 2008 2052 2200 1080 1084 1089 1125 +HSync +VSync
xrandr --addmode DP-1 "1920x1080 60Hz"

You can get the output names by running xrandr with no arguments. To get modelines, use the gtf or cvt programs. The new mode will now be available in your favourite monitor-configuring tool, be that xrandr or your DE’s settings program.

I run this in .xinitrc before starting xfce4.

Getting xfce4’s restart and shutdown buttons to work

This one turned out to be easy. You simply run startxfce4 with the --with-ck-launch option. I had tried this previously with no result, probably because some required package wasn’t installed. I assume this was ConsoleKit, or maybe PolicyKit, and it would have been brought in as a dependency for something else.

For some reason, there are no suspend or hibernate buttons. I don’t know if they’re compiled out in Void, or not being shown because those functions aren’t available. I strongly suspect, due to what I’ve read, that these two rely on systemd to work.

Fixing sound

Intel HDA sound is always a pest. My sound used to work in Arch, but that may have been due to some tweaking that got blown away when the root partition was reformatted. My problem was that sound would go to the headphones when they weren’t plugged in but when they were plugged in, sound would go to the speakers.

I finally stumbled upon the awesome tool hdajackretask, which is a part of alsa-tools. The snd-hda-intel module can be reconfigured on the fly by writing values to the correct section of /sys. You just fiddle around in hdajackrestask until things seem to work right, then grab the shell script it creates from /tmp/hda-jack-retask-??????/script.sh.

I tweaked the script to stop it trying to write logging information to /tmp, and called it from /etc/rc.local in order to apply the sound changes at boot – oh the joy of having rc.local again!

Automounting of USB drives

I’ve been using devmon and udevil for years. With systemd there’s some bodgy-looking method for running devmon when a user logs in. Without systemd you just put it in your .bashrc or equivalent shell startup script. I’m using fish, so what I’ve ended up with is:

pidof -x devmon > /dev/null 2>/dev/null
if test $status -ne 0
    echo "Starting devmon"
    devmon -g &
end

This typically starts devmon when I log in, and logging out should kill it.

Posted Tuesday, January 22, 2019

Blog contents