KDE Plasma 6(Wayland) - Touchpad Gestures (Proper Ones)

  1. Install fusuma
  2. Install ydotool
  3. Modify fusuma config - ~/.config/fusuma/config.yml
swipe:
  3:
    left:
      command: 'ydotool key 125:1 105:1 105:0 125:0' # KEY_LEFTMETA+ KEY_PAGELEFT
    right:
      command: 'ydotool key 125:1 106:1 106:0 125:0' # # KEY_LEFTMETA+ KEY_PAGRIGHT
    up:
      command: 'ydotool key 125:1 104:1 104:0 125:0' # KEY_LEFTMETA+ KEY_PAGEUP
    down:
      command: 'ydotool key 125:1 109:1 109:0 125:0' # KEY_LEFTMETA+ KEY_PAGEDOWN
  

pinch:
  2:
    in:
      command: 'ydotool key 29:1  78:1 78:0 29:0' # KEY_LEFTCTRL + KEY_KPPLUS
    out:
      command: 'ydotool key 29:1  74:1 74:0 29:0' # KEY_LEFTCTRL + KEY_KPMINUS

    
threshold:
  swipe: 0.3
  pinch: 0.1

interval:
  swipe: 1
  pinch: 1
  1. Look for keys codes here - kate /usr/include/linux/input-event-codes.h
  2. Add fusuma to autostart
    fusuma.sh
#!/bin/bash

/home/USER/.local/share/gem/ruby/3.0.0/bin/fusuma

I’ve had a similar config back on X11 with touchegg and touche.
Sadly, instead of an easily configurable and default touchpad gestures, KDE has only pretty useless for me option with 4 fingers UP or DOWN.
Mine config makes it easily to split screen, maximize and minimize windows, zoom in and out.

4 Likes

I have no idea why fusuma and ydotool are so bloated and complicated.
I think I will recreate them and add a simple GUI for it to configure gestures with no hustle.

3 Likes

Wait… are you speaking about the Wayland session?!
We’ve just been discussing yesterday how far we are still in Wayland from customizable gestures.

So how does it work? Are the KDE defaults clashing or properly overridden? Can we implement a pinch in to close?

Finally, it seems that you are mapping gestures to key combinations. Are you aware of any way to trigger commands? (perhaps define first a custom shortcut, then trigger it by gestures)
EDIT: oh I see, ydotool is just one possible command :smiley:

3 Likes

Yep, Wayland.
There’s still NO config for the touchpad gestures, but there’s a config for touchscreen gestures.:clown_face:

Can we implement a pinch in to close?

Yes, pinch is supported for 2, 3 and 4 fingers.
So you can remain zoom for 2 and close windows on 3 or 4 fingers pinch.

What do you mean? No way with Plasma settings / config files?

I’m a bit confused, I don’t believe it yet :joy:, especially after reading several comments of devs from touchegg and fusuma repos. In fact, I would like to know whether Plasma default touchpad gestures are overridden by custom ones.

1 Like

I literally found none, feels like it’s just hardcoded somewhere.

Plasma default touchpad gestures are overridden by custom ones.

The only ones it’s has by default - 4 fingers swipe up or down.

1 Like

Strange, on my Plasma 6 Wayland session, I have 3-swipe left and right that are doing the same as 4-swipes left and right (which I would like to override). And the 4-swipe up and down give workspace views and app views.
I assume that it does not come from touchegg since my config is supposed to do things differently in X11.

1 Like

Well, then for me it’s even a bigger mystery now.

Could you provide more details on the installation process? I try to set it up to make some testing. My questions are:

  1. How do you autostart fusuma?
  2. Where is the config.yml? (nothing in ~/.config)
  3. How do you activate ydotoold?
  4. How do you find the ydotool code you want?

Thanks!

1 Like

It’s a hack that abuses ydotool. See, all the alleged sEcUrITy benefits of Wayland go out the window with this simple hack. Ironic. :rofl:

Now figure out how to run Xeyes. :eyes: I wonder if fusuma can somehow retrive global mouse coordinates and window locations…

3 Likes

I also see other alternatives, like dotool that is supposed to be simpler to use, or a fusuma plugin called sendkey.

I just need to poll quickly, like 30 times per second, the global mouse coordinates, and the global coordinates of a specific window (position and size). The latter doesn’t need to happen quickly, but the former does.

  1. Kde has “autostart” section in setting, add .sh script I provided above.
  2. Everything else I did like in Github of fusuma

Can you please list me a number of features you’ve needed from the Xeyes and which are missing in the Wayland alternatives?

Because currently in my experiments, libinput on wayland seems to be not so maddening “secure” and it’s should be possible to implement as it’s quite global.

1 Like

I could program my own version of Xeyes. I just need two things, which I don’t know how to handle:

  1. Poll for global mouse coordinates, x and y (distance in pixels from the top left corner of the workspace). I need to poll this very quickly, 30 times a second or so, so that the animation of the eyes is smooth.
  2. The Eyes program also needs to know the global position and size of its own window (global coordinates of the top left corner of the window, as well as its width and height). I need to poll for this only when the program window is moved or resized.

Based on these six numbers I can draw the eyes fairly easily.

So, a minimal example I could build upon would be a program that opens a window and prints to stdout the coordinates and size of that window, as well as the global mouse position. Ideally, in C or C++. Programming the eyes would be a fairly trivial task if I had that.

1 Like

Oh my Goooood i feel so secure with Wayland!
We need to throw everything out of the window and break whole ecosystem, immediately! :rofl:

2 Likes

Thank you, I’m aware that you can code, just curious to experiment myself.
I’ll share results if something interesting will be achieved.

1 Like

I like how this cult of security forgets that most of the biggest outbreaks are caused by human factor.
They’re also like to point how Microsoft associates most of their errors with buffer overflow and how Rust could save them from it, if they’d used it instead of C++.

Meanwhile Linux and FreeBSD code are mostly written in C and yet their quality is far superior.
Perhaps problem is the fact that arms of the Microsoft coders are growing from their arses?

1 Like

Well…i don’t think it’s even that (although i have my theory)…
Mostly it’s the fact that security is last thing on their mind, objectively…because it’s literal spyware OS, they’re too busy creating backdoors, telemetry holes and f$ck users in those arses… :rofl:

Eh, pretty much anything IT-related now is a kind of spyware. Problem with Microsoft it’s also a crappy one in general.

Since November for my job I’ve been taking interviews with CEOs, managers and etc.
They’re putting just all kind of possible telemetry in their products because everyone does so, so it’s “trendy” then.
Yet at the same time each damn company thinks that they’re unique, a center of the universe and they’re the only ones who know how to do things right.

I myself still don’t get it entirely how this 2 contradictory things combine.

Like, it’s hilarious to the point when they use telemetry for their inner products. They like to claim it’s used for security to track down if something or someone will fuckup. But in reality, there’s just too much data that’s just keep hoarding in the data bases.