Blog

macOS-like multi-touch support on linux

Recently I came across this beautiful implementation of multi-touch support by the developer Jose Exposito. After trying a lot of alternatives, this is the one which has given me an experience close to what I had on macOS. It is responsive, configurable and just works!

Here goes a demo on elementrayOS:

If you want to give it a try, visit the project’s github page.

In case you don’t want spend too much time editing the touchegg.conf file, you can use mine which is similar to the gestures you find on macOS. Just copy and past this code into the file touchegg.conf located at /home/$USER/.config/touchegg

<touchégg>

  <settings>
    <!--
      Delay, in milliseconds, since the gesture starts before the animation is displayed.
      Default: 150ms if this property is not set.
      Example: Use the MAXIMIZE_RESTORE_WINDOW action. You will notice that no animation is
      displayed if you complete the action quick enough. This property configures that time.
    -->
    <property name="animation_delay">150</property>

    <!--
      Percentage of the animation to be completed to apply the action.
      Default: 20% if this property is not set.
      Example: Use the MAXIMIZE_RESTORE_WINDOW action. You will notice that, even if the
      animation is displayed, the action is not executed if you did not moved your fingers far
      enough. This property configures the percentage of the animation that must be reached to
      execute the action.
    -->
    <property name="action_execute_threshold">20</property>

    <!--
      Global animation colors can be configured to match your system colors here.
      Notice that ou can override an specific animation color.

      Ubuntu (Gnome):
        <color>909090</color>
        <borderColor>FFFFFF</borderColor>

      Kubuntu:
        <color>000000</color>
        <borderColor>000000</borderColor>

      elementary OS:
        <color>3E9FED</color>
        <borderColor>3E9FED</borderColor>

      Fedora:
        <color>3E9FED</color>
        <borderColor>1F7BC4</borderColor>
    -->
    <property name="color">3E9FED</property>
    <property name="borderColor">3E9FED</property>
  </settings>

  <!--
    Configuration for every application.
  -->
  <application name="All">
    <gesture type="SWIPE" fingers="3" direction="UP">
      <action type="MAXIMIZE_RESTORE_WINDOW">
        <animate>true</animate>
      </action>
    </gesture>

    <gesture type="SWIPE" fingers="3" direction="DOWN">
      <action type="MINIMIZE_WINDOW">
        <animate>true</animate>
      </action>
    </gesture>

    <gesture type="SWIPE" fingers="3" direction="LEFT">
      <action type="TILE_WINDOW">
        <direction>left</direction>
        <animate>true</animate>
      </action>
    </gesture>

    <gesture type="SWIPE" fingers="3" direction="RIGHT">
      <action type="TILE_WINDOW">
        <direction>right</direction>
        <animate>true</animate>
      </action>
    </gesture>

    <gesture type="PINCH" fingers="3" direction="IN">
      <action type="CLOSE_WINDOW">
        <animate>true</animate>
        <color>F84A53</color>
        <borderColor>F84A53</borderColor>
      </action>
    </gesture>

    <gesture type="SWIPE" fingers="4" direction="RIGHT">
      <action type="CHANGE_DESKTOP">
        <direction>previous</direction>
        <animate>true</animate>
        <animationPosition>right</animationPosition>
      </action>
    </gesture>

    <gesture type="SWIPE" fingers="4" direction="LEFT">
      <action type="CHANGE_DESKTOP">
        <direction>next</direction>
        <animate>true</animate>
        <animationPosition>left</animationPosition>
      </action>
    </gesture>
    
    <gesture type="SWIPE" fingers="4" direction="UP">
      <action type="SEND_KEYS">
        <repeat>false</repeat>
        <modifiers>Super_L</modifiers>
        <keys>S</keys>
        <on>begin</on>
      </action>
    </gesture>

    <gesture type="PINCH" fingers="4" direction="OUT">
      <action type="SHOW_DESKTOP">
        <animate>true</animate>
      </action>
    </gesture>
    
    <gesture type="PINCH" fingers="4" direction="IN">
      <action type="SEND_KEYS">
        <repeat>false</repeat>
        <modifiers>Super_L</modifiers>
        <keys>A</keys>
        <on>begin</on>
      </action>
    </gesture>
  </application>

  <!--
    Configuration for specific applications.
  -->

  <application name="Google-chrome,Chromium-browser,Firefox, evince">
    <gesture type="PINCH" fingers="2" direction="IN">
      <action type="SEND_KEYS">
        <repeat>true</repeat>
        <modifiers>Control_L</modifiers>
        <keys>KP_Subtract</keys>
        <decreaseKeys>KP_Add</decreaseKeys>
      </action>
    </gesture>

    <gesture type="PINCH" fingers="2" direction="OUT">
      <action type="SEND_KEYS">
        <repeat>true</repeat>
        <modifiers>Control_L</modifiers>
        <keys>KP_Add</keys>
        <decreaseKeys>KP_Subtract</decreaseKeys>
      </action>
    </gesture>
  </application>

  

</touchégg>

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: