trackpad gestures for switching workspaces - Desktop Customization & Workflow

Users browsing this thread: 1 Guest(s)
Long time nixers
i have a thinkpad and use the trackpoint exclusively for mousing, so there's a big part of my wristrest that sits there and does nothing. i used to have a mac and i really liked having the ability to swipe between workspaces using the trackpad. a lot of *nix DEs have the ability to interpret gestures but with WMs, you're pretty much stuck configuring it yourself.

today i decided to get this working and it was a lot easier than i thought it would be. this applies to linux - i haven't tested it on anything else and i don't know if libinput even works on other OSes so ymmv.

xdotool (for non EWMH WMs) or wmctrl (for EWMH WMs)

install libinput-gestures and xdotool but hold off on starting libinput-gestures.
in your wm, configure keyboard shortcuts to switch workspaces/groups*.
for example, in cwm, create bind-key lines for group-cycle and group-rcycle (probably works best with sticky groups).

next, open the libinput-gestures config file and find the swipe left/right gestures and change the xdotool command to match the wm binding.

finally, reload your wm config and start libinput-gestures.

*if you can send a command directly to your wm, i think you can just replace the xdotool command with the workspace switching command and skip adding a keybind to your wm config. i haven't tested this though. this could be pretty useful in conjunction with wmutils!
I like the topic of gestures.

I've added some sort of gesture to my desktop, basically when putting the mouse in my top-right corner the time and date pops up.
I've personally always used scrolling on my bar (always at the bottom across all screens) to switch workspaces. It's not a "gesture" as such, but it has the same effect, especially since I can just throw the cursor to the bottom of the screen and always end up over the bar.

The bar I'm currently using (swaybar) used to switch workspaces on every single scroll event, which made it useless with precise trackpads like the one in my laptop, but I got a patch merged to fix that:
fre d die
Very intresting! i also switched to a thinkpad from my mac, it would actually be quite usefull to switch between workspaces with the trackpoint and scrollbutton, will have to try this out.