Eeems-Org / oxide

A desktop environment for the reMarkable tablet
https://oxide.eeems.codes
MIT License
243 stars 21 forks source link

Can long-press/gestures be reassigned? #359

Open kubycsolutions opened 3 months ago

kubycsolutions commented 3 months ago

I am hoping not to need screen capture very often. It looks like I can turn off the gesture triggering it using rot system call setSwipeEnabled 'int:2' 'bool:false' (I think that's the right one?), but it might be nice to be able to have that gesture invoke a different action.

Might also be nice to be able to distinguish swipes by where they occur on screen, come to think of it, to have more options available.

(I'm used to left and right swipes being next-page and previous-page in Android, or occasionally next/previous app.)

Eeems commented 3 months ago

Screenshot taking is one of the few gestures you can have something else take over. It's managed by the screenshot tool, so you can just disable this application and write your own to handle the gesture: https://github.com/Eeems-Org/oxide/blob/master/applications%2Fscreenshot-tool%2Fmain.cpp

As for adding more complex gesture handling etc, it would be nice, but it's way down the priority list for me. For now you can use https://rmkit.dev/apps/genie to handle more complex gestures and then make calls with rot, or your own applications that use the oxide API to get things done.

jkesselm commented 3 months ago

Understood. It's a WIBNI/wishlist item, not a complaint.

Thanks for the tip about subverting snapshot.

Eeems commented 3 months ago

Here is a bit more information on how to disable the screenshot tool:

  1. Run launcherctl stop-app codes.eeems.fret to stop the application
  2. Modify /opt/usr/share/applications/codes.eeems.fret.oxide and remove "autoStart" from flags to disable the application being started automatically.

You can then either register your own start application to handle the gesture, or have it start with another mechanism like systemd. I would recommend using an oxide application registration, to make sure it starts/stops with oxide's system service.

You just need to listen to the rightAction signal in the system API. The very bottom example shows you how to use rot to listen for the first leftAction signal, so you can use that as a starting point if you just want to write a shell script. I unfortunately don't have any examples other than using rot or liboxide. You would be able to use dbus directly to handle this if you prefer. You'll just need to use the general API to request the system API, and then continue from there.