-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scrolling gesture for notebook? #5
Comments
I agree, but unfortunately the KWin Scripting API doesn't expose mouse or keyboard events and, to my knowledge, neither does QML (other than MouseArea, which is a GUI element). What KWin does allow, though, is to set keyboard bindings, and I could add bindings for scrolling a fixed number of pixels left or right (Karousel actually already had them, but I've removed them as I thought they were superfluous next to the bindings for scrolling one column to the left or right). Then you could use some software for mapping touchpad gestures to simulate a keypress of the same keyboard shortcut that you'd set in Karousel. Any alternative ideas on how to hack this feature into existence are also greatly appreciated. |
maybe this? |
I've reintroduced the key bindings for scrolling a fixed number of pixels left or right. By default they're Meta+Alt+PgUp and Meta+Alt+PgDown. I haven't tried it yet, but it should be possible to use some software (for example Touchegg, as @Thesola10 suggested) to map touchpad gestures to these two keyboard shortcuts. EDIT: I've tried to set this up with Touchegg, but Kwin is ignoring the simulated keyboard shortcut. |
I am using evsieve to bind certain commands to mouse gestures. So far its been the only tool that works for my usescases on Wayland. eg. I send I dont know about touch support, but it might be worth checking it out anyway. |
You can run the commands directly using dbus, I wrote a script (called it #!/bin/bash
echoerr() {
echo "$@" 1>&2
}
usage() {
echoerr "Usage: $0 [ <action> ]"
}
if [ $# -lt 1 ]; then
# qdbus org.kde.kglobalaccel /component/kwin org.kde.kglobalaccel.Component.shortcutNames
# but using busctl.
busctl -j --user call org.kde.kglobalaccel /component/kwin org.kde.kglobalaccel.Component shortcutNames \
| jq -r '.data[0].[]' | grep -e '^karousel-' | sed 's/^karousel-//' | sed 's/[0-9]\+$//' | sort | uniq
exit 0
fi
set -euo pipefail
action="$1"
busctl --user call org.kde.kglobalaccel /component/kwin org.kde.kglobalaccel.Component invokeShortcut "s" "karousel-$action" on and use it e.g.: karouselctl grid-scroll-left |
Totally just got it to work with
<touchégg>
<settings>
<property name="animation_delay">150</property>
<property name="action_execute_threshold">20</property>
<property name="color">auto</property>
<property name="borderColor">auto</property>
</settings>
<application name="All">
<gesture type="SWIPE" fingers="3" direction="LEFT">
<action type="RUN_COMMAND">
<command>~/bin/karouselctl grid-scroll-left</command>
<repeat>true</repeat>
<animation>NONE</animation>
<decreaseCommand>~/bin/karouselctl grid-scroll-right</decreaseCommand>
</action>
</gesture>
<gesture type="SWIPE" fingers="3" direction="RIGHT">
<action type="RUN_COMMAND">
<command>~/bin/karouselctl grid-scroll-right</command>
<repeat>true</repeat>
<animation>NONE</animation>
<decreaseCommand>~/bin/karouselctl grid-scroll-left</decreaseCommand>
</action>
</gesture>
</application>
</touchégg> |
This is awesome! I didn't know about that dbus method. Really useful. Thanks for sharing! |
I am loving the functionality of such a script, as I become more familiar with it I notice the great potential, but to exploit it fully there on notebooks seems to be something missing, such as a gesture on the touchpad, perhaps three touches to one side to move the focus to that direction.
The text was updated successfully, but these errors were encountered: