Touch input with touchpad (libinput) AND touchscreen (synaptics)

To enable touch input the same way with two different inputs (and input libs) on modern laptops and netbooks, in UM17.04.

Touchpad gestures (libinput)

[edit] Works well but there is a compiz problem which is annoying. It prevent multiple xdotool calls until a real keyboard input is made. I work on a solution, or a workaround like a d-bus call for compiz

Works well with libinput-gestures

sudo gpasswd -a $USER input
sudo apt-get install xdotool wmctrl libinput-tools
git clone http://github.com/bulletmark/libinput-gestures
cd libinput-gestures
sudo ./libinput-gestures-setup install
libinput-gestures-setup start

Then for example create the following .config/libinput-gestures.conf :

gesture swipe up 3	xdotool key super+w
gesture swipe up 4	xdotool key super+a
gesture swipe down xdotool key ctrl+alt+d
gesture swipe left	xdotool key alt+Right
gesture swipe right	xdotool key alt+Left

If it runs well, you can add the service in startup item

libinput-gestures-setup autostart

then trash the installation directory

Touchscreen gestures (synaptics)

Add the touchegg service

sudo apt install touchegg
mkdir $HOME/touchegg
touch $HOME/touchegg/touchegg.conf
pluma $HOME/touchegg/touchegg.conf

Configuration example with same input gestures than with touchpad:

<touchégg>
  <settings>
    <property name="composed_gestures_time">111</property>
  </settings>
  <application name="All">
  <gesture type="DRAG" fingers="3" direction="UP">
    <action type="SEND_KEYS">Super+w</action>
  </gesture>
  <gesture type="DRAG" fingers="4" direction="UP">
    <action type="SEND_KEYS">Super+a</action>
  </gesture>
  <gesture type="DRAG" fingers="3" direction="DOWN">
    <action type="SEND_KEYS">ctrl+alt+d</action>
  </gesture>
  <gesture type="DRAG" fingers="4" direction="DOWN">
    <action type="SEND_KEYS">ctrl+alt+d</action>
  </gesture>
  <gesture type="DRAG" fingers="3" direction="LEFT">
    <action type="SEND_KEYS">alt+Right</action>
  </gesture>
  <gesture type="DRAG" fingers="3" direction="RIGHT">
    <action type="SEND_KEYS">alt+Left</action>
  </gesture>
  <gesture type="TAP" fingers="2" direction="">
    <action type="MOUSE_CLICK">BUTTON=3</action>
  </gesture>
  </application>
</touchégg>

Then add the touchegg command in the Startup Applications

It’s your turn to customize the gestures to comply to your tastes !

1 Like