Customizing touchegg

Hello everyone,

I hope you can assist me with a Touchegg customization query. Currently, I have set up a three-finger swipe up gesture in Touchegg to execute the following command:

qdbus org.kde.kglobalaccel /component/kwin invokeShortcut 'Overview'

This command allows me to view all the open applications, which is quite convenient. However, I find that once I’m in the “overview” stage, swiping three fingers up again to return to the previous stage feels a bit unnatural.

Ideally, I would like to modify the behavior so that, while I’m in the “overview” stage, swiping three fingers down would bring me back to the regular desktop view. Then, I could easily return to the “overview” stage again by swiping three fingers up.

Furthermore, when I’m in the normal desktop view, I’d like to be able to swipe three fingers down to show the desktop and swipe three fingers up to revert to the regular view.

At the moment, my Touchegg configuration looks like this:

<touchégg>
  <settings>
    <property name="animation_delay">150</property>
    <property name="action_execute_threshold">10</property>
    <property name="color">auto</property>
    <property name="borderColor">auto</property>
  </settings>
  <application name="All">
    <gesture type="SWIPE" fingers="3" direction="RIGHT">
      <action type="CHANGE_DESKTOP">
        <direction>previous</direction>
        <animate>true</animate>
        <animationPosition>left</animationPosition>
        <color>000000</color>
        <borderColor>000000</borderColor>
      </action>
    </gesture>
    <gesture type="SWIPE" fingers="3" direction="LEFT">
      <action type="CHANGE_DESKTOP">
        <direction>next</direction>
        <animate>true</animate>
        <animationPosition>right</animationPosition>
        <color>000000</color>
        <borderColor>000000</borderColor>
      </action>
    </gesture>
    <gesture type="PINCH" fingers="3" direction="IN">
      <action type="RUN_COMMAND">
        <repeat>false</repeat>
        <command>qdbus org.kde.kglobalaccel /component/kwin invokeShortcut 'ShowDesktopGrid'</command>
        <on>begin</on>
      </action>
    </gesture>
    <gesture type="PINCH" fingers="3" direction="OUT">
      <action type="RUN_COMMAND">
        <repeat>false</repeat>
        <command>qdbus org.kde.kglobalaccel /component/kwin invokeShortcut 'ShowDesktopGrid'</command>
        <on>begin</on>
      </action>
    </gesture>
    <gesture type="SWIPE" fingers="3" direction="DOWN">
      <action type="SHOW_DESKTOP"></action>
    </gesture>
    <gesture type="SWIPE" fingers="3" direction="UP">
      <action type="RUN_COMMAND">
        <command>qdbus org.kde.kglobalaccel /component/kwin invokeShortcut 'Overview'</command>
        <repeat>false</repeat>
        <animation>NONE</animation>
        <on>begin</on>
      </action>
    </gesture>
    <gesture type="SWIPE" fingers="4" direction="LEFT">
      <action type="RUN_COMMAND">
        <command>qdbus org.kde.kglobalaccel /component/kmix invokeShortcut 'decrease_volume'</command>
        <repeat>true</repeat>
        <animation>NONE</animation>
        <decreaseCommand>qdbus org.kde.kglobalaccel /component/kmix invokeShortcut 'increase_volume'</decreaseCommand>
      </action>
    </gesture>
    <gesture type="SWIPE" fingers="4" direction="RIGHT">
      <action type="RUN_COMMAND">
        <command>qdbus org.kde.kglobalaccel /component/kmix invokeShortcut 'increase_volume'</command>
        <repeat>true</repeat>
        <animation>NONE</animation>
        <decreaseCommand>qdbus org.kde.kglobalaccel /component/kmix invokeShortcut 'decrease_volume'</decreaseCommand>
      </action>
    </gesture>
    <gesture type="SWIPE" fingers="4" direction="UP">
      <action type="RUN_COMMAND">
        <command>brightnessctl s +10%</command>
        <repeat>true</repeat>
        <animation>NONE</animation>
        <decreaseCommand>brightnessctl s 10%-</decreaseCommand>
      </action>
    </gesture>
    <gesture type="SWIPE" fingers="4" direction="DOWN">
      <action type="RUN_COMMAND">
        <command>brightnessctl s 10%-</command>
        <repeat>true</repeat>
        <animation>NONE</animation>
        <decreaseCommand>brightnessctl s +10%</decreaseCommand>
      </action>
    </gesture>
  </application>
  <application name="brave-browser">
    <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>
    <gesture type="PINCH" fingers="4" direction="IN">
      <action type="SEND_KEYS">
        <repeat>true</repeat>
        <modifiers>Control_L</modifiers>
        <keys>Shift_L+Tab</keys>
        <decreaseKeys>Shift_L+Tab</decreaseKeys>
        <on>begin</on>
      </action>
    </gesture>
    <gesture type="PINCH" fingers="4" direction="OUT">
      <action type="SEND_KEYS">
        <repeat>true</repeat>
        <modifiers>Control_L</modifiers>
        <keys>Tab</keys>
        <decreaseKeys>Shift_L+Tab</decreaseKeys>
        <on>begin</on>
      </action>
    </gesture>
  </application>
  <application name="chromium">
    <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>
    <gesture type="PINCH" fingers="4" direction="IN">
      <action type="SEND_KEYS">
        <repeat>true</repeat>
        <modifiers>Control_L</modifiers>
        <keys>Shift_L+Tab</keys>
        <decreaseKeys>Shift_L+Tab</decreaseKeys>
        <on>begin</on>
      </action>
    </gesture>
    <gesture type="PINCH" fingers="4" direction="OUT">
      <action type="SEND_KEYS">
        <repeat>true</repeat>
        <modifiers>Control_L</modifiers>
        <keys>Tab</keys>
        <decreaseKeys>Shift_L+Tab</decreaseKeys>
        <on>begin</on>
      </action>
    </gesture>
  </application>
  <application name="firefox">
    <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>
    <gesture type="PINCH" fingers="4" direction="IN">
      <action type="SEND_KEYS">
        <repeat>true</repeat>
        <modifiers>Control_L</modifiers>
        <keys>Shift_L+Tab</keys>
        <decreaseKeys>Shift_L+Tab</decreaseKeys>
        <on>begin</on>
      </action>
    </gesture>
    <gesture type="PINCH" fingers="4" direction="OUT">
      <action type="SEND_KEYS">
        <repeat>true</repeat>
        <modifiers>Control_L</modifiers>
        <keys>Tab</keys>
        <decreaseKeys>Shift_L+Tab</decreaseKeys>
        <on>begin</on>
      </action>
    </gesture>
  </application>
  <application name="google-chrome">
    <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>
    <gesture type="PINCH" fingers="4" direction="IN">
      <action type="SEND_KEYS">
        <repeat>true</repeat>
        <modifiers>Control_L</modifiers>
        <keys>Shift_L+Tab</keys>
        <decreaseKeys>Shift_L+Tab</decreaseKeys>
        <on>begin</on>
      </action>
    </gesture>
    <gesture type="PINCH" fingers="4" direction="OUT">
      <action type="SEND_KEYS">
        <repeat>true</repeat>
        <modifiers>Control_L</modifiers>
        <keys>Tab</keys>
        <decreaseKeys>Shift_L+Tab</decreaseKeys>
        <on>begin</on>
      </action>
    </gesture>
    <gesture type="PINCH" fingers="2" direction="IN">
      <action type="SEND_KEYS">
        <modifiers>Control_L</modifiers>
        <keys>KP_Subtract</keys>
        <repeat>false</repeat>
        <animation>NONE</animation>
        <on>begin</on>
      </action>
    </gesture>
  </application>
  <application name="gwenview">
    <gesture type="PINCH" fingers="2" direction="IN">
      <action type="SEND_KEYS">
        <modifiers>Control_L</modifiers>
        <keys>KP_Subtract</keys>
        <repeat>false</repeat>
        <animation>NONE</animation>
        <on>begin</on>
      </action>
    </gesture>
    <gesture type="PINCH" fingers="2" direction="OUT">
      <action type="SEND_KEYS">
        <modifiers>Control_L</modifiers>
        <keys>KP_Add</keys>
        <repeat>true</repeat>
        <animation>NONE</animation>
        <decreaseKeys>KP_Subtract</decreaseKeys>
      </action>
    </gesture>
  </application>
</touchégg>

If any of you have encountered a similar scenario or know how to achieve the desired touchpad gesture behavior, I would greatly appreciate your guidance. Thank you in advance for your help!