2-Finger Pinch Zoom Gesture not working smoothly on KDE

Hello, I’m new to Linux and Manjaro. I’m trying to set my gestures similar to how they were set on my old Mac Book Air. I’ve set up the 3 finger swipe properly, however, I’m having trouble getting 2-finger pinch zoom to work properly.

I did get it to work using xdotool key Control + 0x002b & xdotool key Control + 0x002d. But that doesn’t zoom in and out smoothly, it’s very choppy.

I currently have it set to xdotool key Meta+0x002b & xdotool key Meta+0x002d for zoom in and out, but it doesn’t do anything.

1 Like

Install xdotool and libinput-gestures:

sudo pacman -S xdotool libinput-gestures

Follow these steps to configure libinput-gestures:

sudo gpasswd -a <user_name> input #add user in input group
libinput-gestures-setup desktop #set up the application using your [DE](https://specifications.freedesktop.org/autostart-spec/autostart-spec-latest.html)
libinput-gestures-setup autostart #enable the app to start automatically in the background
libinput-gestures-setup start #start the app immediately in the background:

Make a file ~/.config/libinput-gestures.conf and add these contents:

# Go back/forward in chrome
gesture: swipe right 3 xdotool key Alt+Left
gesture: swipe left 3 xdotool key Alt+Right

# Zoom in / Zoom out
gesture: pinch out xdotool key Ctrl+plus
gesture: pinch in xdotool key Ctrl+minus
  
# Switch between desktops
gesture: swipe left 4 xdotool set_desktop --relative 1
gesture: swipe right 4 xdotool set_desktop --relative -- -1

Reboot :crossed_fingers:

1 Like

PS: you can also use the gestures GUI application for libinput-gestures if you don’t want to work with the config file

1 Like

https://aur.archlinux.org/packages/gestures/

2 Likes

I have used both. work well on Plasma KDE. two fingers zoom in and out work in firefox.

1 Like

Thank you for the response.

So, I actually did those steps initially with the GUI app. I was able to get Zoom in / Zoom out to work using Ctrl+plus & Ctrl+minus; except that I just used the codes 0x002b and 0x002d respectively.

But, that type of zoom looks choppy to me and I see that you can zoom in/out using the windows/meta/super key + plus or minus. The second option look much smoother and it would be nice if I could do that instead. To reiterate, I’d like to zoom in/out using the Windows/Meta/Super key and not with the control key.

However, when I added that in the gestures app it didn’t work. So if I add:
gesture pinch out xdotool key Meta + 0x002b
gesture pinch in xdotool key Meta + 0x002d
Neither of them work

Thank you for showing me to switch between desktops by the way, I was wondering how I could do that.

This should be like this:

gesture: pinch out xdotool key Meta+0x002b
gesture: pinch in xdotool key Meta+0x002d
1 Like

Sorry, that is how I actually have it in the gestures GUI app, I typed it wrong in the forum.

It still doesn’t work with that format.

We can give it a try by using Meta_L instead of Meta:

gesture: pinch out xdotool key 0xffe7+0x002b
gesture: pinch in xdotool key 0xffe7+0x002d
1 Like

It didn’t work, when I use the gestures it does nothing.

This did work with Ctrl+plus and same for minus. The default zoom in/out for kde is Meta+equal and Meta+minus. So rather than using + and - use = and -:

gesture: pinch out xdotool key Meta_L+equal
gesture: pinch in xdotool key Meta_L+minus

:crossed_fingers:

1 Like

It still doesn’t seem to be working.

In my GUI Gestures app I have
xdotool key 0xffe7+0x003d
for Meta_L+equal
and
xdotool key 0xffe7+0x002d
for Meta_L+minus

In the config file it’s formatted like this
gesture pinch in 2 xdotool key 0xffe7+0x003d
gesture pinch out 2 xdotool key 0xffe7+0x002d

I won’t be able to help any further. You can go through these steps again and replace the lines at the bottom:

Also consider going through this:

1 Like

Worked!

Use Super_L instead of Meta_L. This is how the config looks:

# Zoom in / Zoom out
gesture: pinch out xdotool key Super_L+equal
gesture: pinch in xdotool key Super_L+minus

Make sure you are using the default shortcuts for zoom in/out in kde shortcut settings. This is strange because it wasn’t working with Meta even though here it’s given Meta only:

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.