bulletmark / libinput-gestures

Actions gestures on your touchpad using libinput
3.93k stars 241 forks source link

Multiple execution of commands #296

Open MidnightNerd opened 3 years ago

MidnightNerd commented 3 years ago

Hello, this code should allow users to execute code multiple times when making a swipe gesture.

There are some things that need to be mentioned: 1. CPU load is slightly higher than in previous version. The impact on battery life isn't notable on modern machines.

  1. The config file must specify the number of fingers. The config syntax is: gesture swipe direction numFingers Threshold command. -->Maybe its better to add a new command for the config file. 3. The command will be executed one time more at the end of the gesture. (this is fixed)

Edit: here are two example configuration lines to try this feature(Volume control):

Swipe with 4 fingers up or down to increase/decrease Volume

timeout 5 gesture swipe up 4 40 xdotool key XF86AudioRaiseVolume gesture swipe down 4 40 xdotool key XF86AudioLowerVolume

MidnightNerd commented 3 years ago

Maybe this is not really clear: This Patch is not for executing a specific command at the end of a swipe gesture multiple times, this Patch executes a command while the gesture is done.

solarfl4re commented 3 years ago

I merged @MidnightNerd's code into the latest master on my Arch machine and installed it. Swipe to adjust volume works perfectly - thanks, @MidnightNerd!

For other Arch users, I modified the libinput-gestures PKGBUILD from AUR to use the local git repo where I merged MidnightNerd's code into the latest master:

3c3
< pkgver=2.62
---
> pkgver=2.70
15c15
< source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz")
---
>   source=("git+file:///home/david/repos/libinput-gestures/src/$pkgname")
17c17
< md5sums=('03fcc64ffc0150ea6ddefb1f4af85edd')
---
> md5sums=('SKIP')
20c20
<   cd "$pkgname-$pkgver"
---
>   cd "$pkgname"
jujuscream commented 2 years ago

THANK YOU!

Finally got around to trying this vs. the old one. This works perfectly and it's exactly what I wanted!

nikelborm commented 1 year ago

Why is this pull request still opened if it was merged?

MidnightNerd commented 1 year ago

i do not have much experience with git. As far as i can see the code wasn't merged.

nikelborm commented 1 year ago

Screenshot from 2023-02-26 18-13-09

Oh, I just misinterpreted this

a7n007 commented 1 year ago

Unsubscribe

On Sun, Feb 26, 2023, 8:13 AM nikel @.***> wrote:

[image: Screenshot from 2023-02-26 18-13-09] https://user-images.githubusercontent.com/29357907/221419230-742d1503-5ee8-466c-a1e2-e00928328a57.png

Oh, I just misinterpreted this

— Reply to this email directly, view it on GitHub https://github.com/bulletmark/libinput-gestures/pull/296#issuecomment-1445386014, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHAI5QA7HM6ZXO2P2DSUJETWZNXLJANCNFSM4ZX3RLLQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>