3

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?

3 Answers3

1

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.

0

A better way to enable tap, two-finger tap, natural scrolling, and even the modern GNOME three-finger swipe, is to switch to libinput instead of synaptics driver. There is a sample configuration to blacklist the xf86-input-synaptics module, but I decided just to switch to Wayland altogether:

;;…
  (services (modify-services
;;…
            (gdm-service-type config => (gdm-configuration
               (inherit config)
               (wayland? #t)))
            ))
;;…

After reboot, the default session should be wayland, you can check that it is not X11 under the small gear ⚙️ in the right bottom corner of the GDM screen. After login, you can check the current session from terminal with echo $XDG_SESSION_TYPE.

Don't forget to switch "Tap to Click" on in the GNOME control center.


Update: Guix System is now using libinput by default. It is worth noting that libinput does not interpret a three-finger swipe, pinch-to-zoom and similar "touchscreen gestures" by itself. Instead, it passes them to Wayland or X client. It just happens that with X those are not configured or does not work (at least in Fedora and Guix), so with libinput switching to Wayland is necessary to make them work.

0

Copy /usr/share/X11/xorg.conf.d/70-synaptics.conf to /etc/X11/xorg.conf.d/ and edit:

Section "InputClass"
...
        Option "TapButton2" "3"