Skip to content

Custom touchpad gestures for KDE Plasma 6

License

Notifications You must be signed in to change notification settings

taj-ny/kwin-gestures

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KWin Gestures

Custom touchpad gestures for KDE Plasma 6.

Tested on 6.1.5 and 6.2. X11 is not supported.

Features

  • Override built-in gestures
  • Application-specific gestures

Installation

NixOS (flakes)

flake.nix:

{
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";

    kwin-gestures = {
      url = "github:taj-ny/kwin-gestures";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };
}
{ inputs, pkgs, ... }:

{
  environment.systemPackages = [
    inputs.kwin-gestures.packages.${pkgs.system}.default
  ];
}

Building from source

Dependencies

Note

The dependencies were copied from another project. Not all of them are necessary.

  • CMake
  • Extra CMake Modules
  • Plasma 6
  • Qt 6
  • KF6
  • KWin development packages
Arch Linux
sudo pacman -S --needed base-devel git extra-cmake-modules qt6-tools
Debian-based (KDE Neon, Kubuntu, Ubuntu)
sudo apt install git cmake g++ extra-cmake-modules qt6-tools-dev kwin-dev libkf6configwidgets-dev gettext libkf6crash-dev libkf6globalaccel-dev libkf6kio-dev libkf6service-dev libkf6notifications-dev libkf6kcmutils-dev libkdecorations2-dev
Fedora
sudo dnf install git cmake extra-cmake-modules gcc-g++ kf6-kwindowsystem-devel plasma-workspace-devel libplasma-devel qt6-qtbase-private-devel qt6-qtbase-devel cmake kwin-devel extra-cmake-modules kwin-devel kf6-knotifications-devel kf6-kio-devel kf6-kcrash-devel kf6-ki18n-devel kf6-kguiaddons-devel libepoxy-devel kf6-kglobalaccel-devel kf6-kcmutils-devel kf6-kconfigwidgets-devel kf6-kdeclarative-devel kdecoration-devel kf6-kglobalaccel kf6-kdeclarative libplasma kf6-kio qt6-qtbase kf6-kguiaddons kf6-ki18n wayland-devel
openSUSE
sudo zypper in git cmake-full gcc-c++ kf6-extra-cmake-modules kcoreaddons-devel kguiaddons-devel kconfigwidgets-devel kwindowsystem-devel ki18n-devel kiconthemes-devel kpackage-devel frameworkintegration-devel kcmutils-devel kirigami2-devel "cmake(KF6Config)" "cmake(KF6CoreAddons)" "cmake(KF6FrameworkIntegration)" "cmake(KF6GuiAddons)" "cmake(KF6I18n)" "cmake(KF6KCMUtils)" "cmake(KF6KirigamiPlatform)" "cmake(KF6WindowSystem)" "cmake(Qt6Core)" "cmake(Qt6DBus)" "cmake(Qt6Quick)" "cmake(Qt6Svg)" "cmake(Qt6Widgets)" "cmake(Qt6Xml)" "cmake(Qt6UiTools)" "cmake(KF6Crash)" "cmake(KF6GlobalAccel)" "cmake(KF6KIO)" "cmake(KF6Service)" "cmake(KF6Notifications)" libepoxy-devel kwin6-devel

Building

git clone https://github.com/taj-ny/kwin-gestures
cd kwin-gestures
mkdir build
cd build
cmake ../ -DCMAKE_INSTALL_PREFIX=/usr
make
sudo make install

Remove the build directory when rebuilding the effect.

Usage

Note

If the effect stops working after a system upgrade, you will need to rebuild it.

  1. Install the plugin.
  2. Open the Desktop Effects page in System Settings.
  3. Enable the Gestures effect in the Tools category.

See docs/configuration.md for instructions on how to configure this plugin.

Gesture recognition issues

Before reporting any issues related to gesture recognition, run libinput debug-events as root and ensure the gesture is recognized properly. If it's not, there's nothing I can do.

Depending on the touchpad, 3 or 4-finger pinch gestures may sometimes be incorrectly interpreted as swipe gestures due to the touchpad only being able to track 2 fingers. As a workaround, move only 2 fingers in opposite directions. See https://wayland.freedesktop.org/libinput/doc/1.25.0/gestures.html#gestures-on-two-finger-touchpads for more information.

Credits

  • KWin - Gesture recognition code (parts of it), sending keystrokes