<touchégg>
  <settings>
    <property name="animation_delay">150</property>
    <property name="action_execute_threshold">20</property>
    <property name="color">auto</property>
    <property name="borderColor">auto</property>
  </settings>
  <application name="All">
    <!-- 3-finger pinch in: Close window -->
    <gesture type="PINCH" fingers="3" direction="IN">
      <action type="CLOSE_WINDOW">
        <animate>true</animate>
        <color>F84A53</color>
        <borderColor>F84A53</borderColor>
      </action>
    </gesture>
    
    <!-- 2-finger tap: Right click -->
    <gesture type="TAP" fingers="2" direction="UNKNOWN">
      <action type="MOUSE_CLICK">
        <button>3</button>
        <on>begin</on>
      </action>
    </gesture>
    
    <!-- 3-finger tap: Middle click -->
    <gesture type="TAP" fingers="3" direction="UNKNOWN">
      <action type="MOUSE_CLICK">
        <button>2</button>
        <on>begin</on>
      </action>
    </gesture>
    
    <!-- 4-finger pinch in: Fullscreen mode 0 -->
    <gesture type="PINCH" fingers="4" direction="IN">
      <action type="RUN_COMMAND">
        <command>hyprctl dispatch fullscreen 0</command>
        <repeat>false</repeat>
        <animation>NONE</animation>
        <on>begin</on>
      </action>
    </gesture>
    
    <!-- 4-finger pinch out: Fullscreen mode 1 -->
    <gesture type="PINCH" fingers="4" direction="OUT">
      <action type="RUN_COMMAND">
        <command>hyprctl dispatch fullscreen 1</command>
        <repeat>false</repeat>
        <animation>NONE</animation>
        <on>begin</on>
      </action>
    </gesture>
    
    <!-- 4-finger swipe left: Show right sidebar (quickshell equivalent) -->
    <gesture type="SWIPE" fingers="4" direction="LEFT">
      <action type="RUN_COMMAND">
        <command>quickshell -c "sidebarRight.visible = !sidebarRight.visible"</command>
        <repeat>false</repeat>
        <animation>NONE</animation>
        <on>begin</on>
      </action>
    </gesture>
    
    <!-- 4-finger swipe right: Show left sidebar (quickshell equivalent) -->
    <gesture type="SWIPE" fingers="4" direction="RIGHT">
      <action type="RUN_COMMAND">
        <command>quickshell -c "sidebarLeft.visible = !sidebarLeft.visible"</command>
        <repeat>false</repeat>
        <animation>NONE</animation>
        <on>begin</on>
      </action>
    </gesture>
    
    <!-- 4-finger swipe up: Show cheatsheet (quickshell equivalent) -->
    <gesture type="SWIPE" fingers="4" direction="UP">
      <action type="RUN_COMMAND">
        <command>quickshell -c "cheatsheet.visible = !cheatsheet.visible"</command>
        <repeat>false</repeat>
        <animation>NONE</animation>
        <on>begin</on>
      </action>
    </gesture>
    
    <!-- 4-finger swipe down: Show overview (quickshell equivalent) -->
    <gesture type="SWIPE" fingers="4" direction="DOWN">
      <action type="RUN_COMMAND">
        <command>quickshell -c "overview.visible = !overview.visible"</command>
        <repeat>false</repeat>
        <animation>NONE</animation>
        <on>begin</on>
      </action>
    </gesture>
  </application>
  
  <!-- Browser-specific gestures for zoom -->
  <application name="chromium-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>
  </application>
  
  <application name="google-chrome">
    <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>
  
  <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>
  </application>
</touchégg>
