Skip to content

Instantly share code, notes, and snippets.

@tm9k1
Last active February 25, 2024 10:56
Show Gist options
  • Save tm9k1/2972988f8ccd920b37284ffc20a2f835 to your computer and use it in GitHub Desktop.
Save tm9k1/2972988f8ccd920b37284ffc20a2f835 to your computer and use it in GitHub Desktop.
(AUR) Gestures for any DE (especially KDE Plasma)

Gestures support for any DE

  1. Install Gestures support
yay -S libinput-gestures gestures
  1. Set up autostart for gestures
libinput-gestures-setup autostart
  1. Add our current user to the input group
sudo gpasswd -a $USER input
  1. Start Gestures and set up your gestures

KDE Plasma

  • Get list of shortcuts by this command

    qdbus org.kde.kglobalaccel /component/kwin org.kde.kglobalaccel.Component.shortcutNames
    
  • Set up gestures with commands like for "Switch One Desktop Down"

    dbus-send  --session  --dest=org.kde.kglobalaccel  --type=method_call  --reply-timeout=2000  /component/kwin org.kde.kglobalaccel.Component.invokeShortcut string:"Switch One Desktop Down"
    

My Gestures

  • swipe 3 finger (natural) to move to other desktop
  • swipe 4 finger to move a window to other desktop
  • pinch_in 3 fingers minimize window
  • pinch_out 3 fingers maximize window
  • pinch_in 4 fingers close window
# Generated by Gestures 0.2.5  -->  https://gitlab.com/cunidev/gestures
# Manual editing might result in data loss!


# Invalid lines


# Unsupported lines

# Swipe threshold (0-100)
swipe_threshold 1

# Gestures
gesture swipe up 3 dbus-send  --session  --dest=org.kde.kglobalaccel  --type=method_call  --reply-timeout=2000  /component/kwin org.kde.kglobalaccel.Component.invokeShortcut string:"Switch One Desktop Down"
gesture swipe down 3 dbus-send  --session  --dest=org.kde.kglobalaccel  --type=method_call  --reply-timeout=2000  /component/kwin org.kde.kglobalaccel.Component.invokeShortcut string:"Switch One Desktop Up"
gesture swipe left 3 dbus-send  --session  --dest=org.kde.kglobalaccel  --type=method_call  --reply-timeout=2000  /component/kwin org.kde.kglobalaccel.Component.invokeShortcut string:"Switch One Desktop to the Right"
gesture swipe right 3 dbus-send  --session  --dest=org.kde.kglobalaccel  --type=method_call  --reply-timeout=2000  /component/kwin org.kde.kglobalaccel.Component.invokeShortcut string:"Switch One Desktop to the Left"
gesture swipe up 4 dbus-send  --session  --dest=org.kde.kglobalaccel  --type=method_call  --reply-timeout=2000  /component/kwin org.kde.kglobalaccel.Component.invokeShortcut string:"Window One Desktop Up"
gesture swipe down 4 dbus-send  --session  --dest=org.kde.kglobalaccel  --type=method_call  --reply-timeout=2000  /component/kwin org.kde.kglobalaccel.Component.invokeShortcut string:"Window One Desktop Down"
gesture swipe left 4 dbus-send  --session  --dest=org.kde.kglobalaccel  --type=method_call  --reply-timeout=2000  /component/kwin org.kde.kglobalaccel.Component.invokeShortcut string:"Window One Desktop to the Left"
gesture swipe right 4 dbus-send  --session  --dest=org.kde.kglobalaccel  --type=method_call  --reply-timeout=2000  /component/kwin org.kde.kglobalaccel.Component.invokeShortcut string:"Window One Desktop to the Right"
gesture pinch out 3 dbus-send  --session  --dest=org.kde.kglobalaccel  --type=method_call  --reply-timeout=2000  /component/kwin org.kde.kglobalaccel.Component.invokeShortcut string:"Window Maximize"
gesture pinch in 3 dbus-send  --session  --dest=org.kde.kglobalaccel  --type=method_call  --reply-timeout=2000  /component/kwin org.kde.kglobalaccel.Component.invokeShortcut string:"Window Minimize"
gesture pinch in 4 dbus-send  --session  --dest=org.kde.kglobalaccel  --type=method_call  --reply-timeout=2000  /component/kwin org.kde.kglobalaccel.Component.invokeShortcut string:"Window Close"


@ibrahimkettaneh
Copy link

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment