The One with the Thoughts of Frans

Mimic Windows Touchpad Gestures in Xfce with libinput-gestures

Windows and Mac have added some conveniences over the past decade that I’m missing to some degree, also see my post on mimicking Windows snap hotkeys in Xfce. There’s something called libinput-gestures, supposed to be an interim solution but it is nonetheless extremely useful. The website contains installation instructions but here’s the rundown based on my installation notes.

libinput-tools is a required package to install for people like me who use Debian and derivaties, xdotool is to automate X11, mostly through faking keyboard presses. Docs here.

sudo apt install libinput-tools xdotool

Compile and install the actual program:

git clone http://github.com/bulletmark/libinput-gestures
cd libinput-gestures
sudo make install

Copy the global config to your user dir so you don’t need sudo to edit:

cp /etc/libinput-gestures.conf ~/.config/libinput-gestures.conf

Ensure you have permission to read input from the touchpad:

sudo gpasswd -a $USER input

NB Normally if you’re not a part of a group by default it’s for sensible security reasons. In this case you’re giving more programs access to your input so the negative implications are fairly self-evident.

The program can now be controlled through the libinput-gestures-setup command. You probably want to set it up to autostart:

libinput-gestures-setup autostart

While playing around with the configuration you’ll probably be using libinput-gestures-setup restart a fair bit.

As the docs say, log out of your session and log back in (or just restart) to make it work.

There are some default gestures of possible use, but I’d rather keep it closer to Windows insofar as I don’t dislike what it does to reduce disconnects when switching between systems. As such I’d stick with three finger swipe up (away from yourself) to mean window switching. For example, if you have Nimbler or something equivalent installed you can use xdotool to trigger it, whether through the default F10 or my preferred Alt+`. On various systems you also have overviews similar to Windows and Exposé. Of course I’d be remiss if I didn’t point out that as far as I know Compiz Scale preceded it, but that aside.

gesture swipe up 3	xdotool key F10
gesture swipe up 4	xdotool key alt+F1

That Alt+F1 is to trigger the global menu in Xfwm. It’s just something I’ve got in there as an experiment. We’ll see how it goes.

Should you decide to use the default gestures for back & forward in the browser, you still have to customize them because they go in the wrong direction by default. Left is back, not forward, and vice versa.

gesture swipe left	xdotool key alt+Left
gesture swipe right	xdotool key alt+Right

It’s a little rough around the edges but definitely a lot better than nothing.

Useful links

Leave a Comment

You must be logged in to post a comment.