Add libinput-gestures config

This commit also adds an old script used for facilitating browser
navigation backwards with a 4-finger swipe, as Firefox previously was
not handling overscroll navigation correctly. It is no longer in use as
the fix in the comments of these files made precise scrolling work,
which in turn made overscroll navigation work as well.
master
Jordan Atwood 2 years ago
parent d7c65303dd
commit e659bd2a66
Signed by: nightfirecat
GPG Key ID: 606EB04257393F88
  1. 23
      src/.bin/libinput-gestures-browser-back.sh
  2. 22
      src/.config/libinput-gestures.conf

@ -0,0 +1,23 @@
#!/usr/bin/env bash
###
### An xdotools composing script to detect whether the active window is a
### browser (tested against Firefox and Chromium) and, if so, send a Backspace
### to it to attempt to navigate to the previous page.
### This is no longer used as activating precise scrolling via adding
### `MOZ_USE_XINPUT2=1` to `/etc/environment` fixes 2-finger scrolling
### activating previous and next page behavior in Firefox.
### See: https://askubuntu.com/a/1149543/464000
###
wid="$(
comm -12 \
<(xdotool getactivewindow) \
<(cat \
<(xdotool search --classname Navigator) \
<(xdotool search --classname chromium) \
| sort)
)"
if [ -n "$wid" ]; then
xdotool key --window "$wid" BackSpace
fi

@ -0,0 +1,22 @@
# 3-finger swipe left/right to switch to left/right desktop
gesture swipe left 3 qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "Switch One Desktop to the Left"
gesture swipe right 3 qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "Switch One Desktop to the Right"
# 3-fnger swipe up or down to toggle KDE Plasma overview (similar to MacOS
# "Mission Control")
# Ideally I'd like to only toggle it with 3-finger swipe up, however then it
# could only be de-activated by 3-finger swiping up again which is very
# counter-intuitive. Hence, giving the same behavior to both makes it feel
# right.
gesture swipe up 3 qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "Overview"
gesture swipe down 3 qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "Overview"
# 4-finger pinch in shows KDE Plasma desktop grid (shows all virtual desktops
# at once)
gesture pinch in 4 qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "ShowDesktopGrid"
# Deprecated: 4-finger swipe left triggers browser back
# This is no longer needed as adding `MOZ_USE_XINPUT2=1` to `/etc/environment`
# fixes 2-finger left/right swiping functioning as back and forward.
# See: https://askubuntu.com/a/1149543/464000
#gesture swipe left 4 ~/.bin/libinput-gestures-browser-back.sh
Loading…
Cancel
Save