Closed gschaffner closed 5 years ago
The second last paragraph in the configuration section discusses this and shows you the easy way to do what you want, i.e. put everything you want to do in a shell script (with appropriate shebang).
Thanks for the quick response!
I also thought an an external script would be one good way to accomplish this behavior. Since it's a closely related task to _internal ws_up
and ws_down
though, do you think that a PR to add this feature directly to libinput-gestures _internal
is reasonable?
The _internal
command exists really just to provide a default for switching workspaces in a DE and Wayland/Xorg independent manner, i.e. it works for GNOME, KDE out of the box.
I see that the shell script issue is not the real point of your problem here. You are suggesting to augment the _internal
command with some more sub-commands, e.g. ws_right_up
etc, in particular to use with the "extended swipe" gestures. E.g in a 2x2 desktop you could swipe right_down
to go immediately from top-left quadrant to bottom-right. I can see the merit in that although it has no use in GNOME which I use and probably only is useful in KDE where you could just as well write your own script.
I will think about this as a suggested enhancement.
I've add this feature with commit bc69ac9a02d11d9996b939660237bb3ec0525608. See the updated libinput-gestures.conf
file for how to configure it.
Description
It seems that the way commands are executed doesn't allow for full shell syntax. For example, a configuration with
gesture swipe right_up 3 notify-send "hi" && notify-send "hello"
will cause an error when the gesture is triggered:However, this is not unfixable. Examples of this sort can be made to behave as intended with
bash -c "$command"
. For example, configurationgesture swipe right_up 3 bash -c "notify-send "hi" && notify-send "hello""
will cause the intended behavior of two separate notifications being sent.However, this
bash -c "$command"
method doesn't allow one to trigger multiple_internal
commands with a single gesture. For example, a configuration likegesture swipe right_up 3 _internal --col=2 ws_down && _internal --row=3 ws_up
would be a useful extension to the usual 4 orthogonal gestures. However, it causes an error when launching libinput-gestures:If you have
Super_L+Control_L+{Up,Down,Left,Right}
bound to switch workspaces, a potential workaround for this example isgesture swipe right_up 3 xte 'keydown Super_L' 'keydown Control_L' 'key Down' 'key Left' 'keyup Super_L' 'keyup Control_L'
. (xte
is in packagexautomation
.) Another workaround would be to call an external script that works withwmctrl -d
and-s
.Would you be open to a small PR that adds new _internal commands for diagonal workspace navigation? And possibly also ws_right and ws_left commands, allowing for more easily-read configs?
Version Info