Skip to content

Instantly share code, notes, and snippets.

@imabuddha
Last active December 14, 2020 15:24
Show Gist options
  • Save imabuddha/48ebefd56d232ec443cfd9b34e3e7ace to your computer and use it in GitHub Desktop.
Save imabuddha/48ebefd56d232ec443cfd9b34e3e7ace to your computer and use it in GitHub Desktop.
My libinput-gestures config. Similar trackpad gesture mapping to my MacBook.
# Configuration file for libinput-gestures.
# JDM — 12/11/2020
# Thanks to: Mark Blakeney, Sep 2015
#
# The default configuration file exists at /etc/libinput-gestures.conf
# but a user can create a personal custom configuration file at
# ~/.config/libinput-gestures.conf.
#
# Each gesture line has 3 [or 4] arguments separated by whitespace:
#
# action motion [finger_count] command
#
# where action and motion is either:
# swipe up
# swipe down
# swipe left
# swipe right
# swipe left_up
# swipe left_down
# swipe right_up
# swipe right_down
# pinch in
# pinch out
# pinch clockwise
# pinch anticlockwise
#
# command is the remainder of the line and is any valid shell command +
# arguments.
###############################################################################
# SWIPE GESTURES:
###############################################################################
# Browser go forward (works only for Xorg, and Xwayland clients)
gesture swipe right 3 xdotool key alt+Right
# Browser go back (works only for Xorg, and Xwayland clients)
gesture swipe left 3 xdotool key alt+Left
# active window toggle maximize
gesture swipe up 3 wmctrl -r :ACTIVE: -b toggle,maximized_vert,maximized_horz
# active window minimize
gesture swipe down 3 xdotool getactivewindow windowminimize %@
# active window toggle fullscreen
gesture swipe up 4 xdotool key F11
# Move to next workspace (works for GNOME/KDE/etc on Wayland and Xorg)
gesture swipe left 4 _internal ws_up
# Move to prev workspace (works for GNOME/KDE/etc on Wayland and Xorg)
gesture swipe right 4 _internal ws_down
###############################################################################
# PINCH GESTURES:
###############################################################################
# zoom -/+
gesture pinch in 2 xdotool key ctrl+minus
gesture pinch out 2 xdotool key ctrl+plus
# show/hide desktop
gesture pinch in 4 wmctrl -k off
gesture pinch out 4 wmctrl -k on
# Optional extended pinch gestures:
# gesture pinch clockwise <whatever command>
# gesture pinch anticlockwise <whatever command>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment