Enable tap, two finger tap, and natural scrolling in Guix

guixsdsynaptictouchpadx11xorg

After booting Guix for the first time, I noticed that tapping on touchpad doesn't render any action. Apparently, Guix comes with a default configuration for touchpad allowing me to click on touchpad, which is mostly sufficient, but having tap disabled, which may be tiring with extensive touchpad use. This is similar to the default configuration one could encounter on Debian.

For just in case, I used xinput list to find out the name of the touchpad, and xinput list-props followed by the touchpad name, to check its capabilities.

Then I found the location of synclient binary with find, and, consulting the synaptics(4) man page online, invoked synclient with TapButton1=1 to enable one-finger tap, then with TapButton2=3 to set two-finger tap to right button event (which brings the right-click menu). While on it, I also enabled horizontal two-finger scrolling with HorizTwoFingerScroll=1, as well as natural scrolling by setting the VertScrollDelta and HorizScrollDelta to the same values which I learned from xinput list-props but negative (by adding - before each value).

Now, one would typically add this settings to /etc/X11/xorg.conf.d/70-synaptics.conf. But since this is Guix, the file is not in /etc but in the GNU store and the touchpad driver is supposed to be configured in /etc/config.scm. The GNU Guix Reference Manual for version 1.3.0 doesn't mention how to configure synaptics.

What can I do on a Guix system, so that I do not need configuring the touchpad myself after each login?

Best Answer

I installed xf86-input-synaptics in my user profile with guix install xf86-input-synaptics to put synclient in path for my user. (This operation completed even without any Internet connection!) With that, I use the following script now:

#! /run/current-system/profile/bin/bash

# Enable one-finger tap and double tap
synclient TapButton1=1

# Enable two-finger tap to open right-click menu
synclient TapButton2=3

# Enable horizontal scroll with two fingers
synclient HorizTwoFingerScroll=1

# Enable natural scrolling
synclient VertScrollDelta=-"$(synclient | grep VertScrollDelta | cut -d '=' -f 2 | cut -c 2-)"
synclient HorizScrollDelta=-"$(synclient | grep HorizScrollDelta | cut -d '=' -f 2 | cut -c 2-)"

I chose to store it in ~/.local/bin/synaptics-user-settings and put the following autostart file at ~/.config/autostart/load-synaptics-user-settings.desktop. (/home/roman is my home directory.)

[Desktop Entry]
Type=Application
Exec=/home/roman/.local/bin/load-synaptics-user-settings
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true

Anyway, this feels like a workaround.

Related Question