05-23-2020, 08:59 PM
(05-23-2020, 05:42 PM)visiblink Wrote: I've been playing around with sxmo and I really like it.
I want to add a couple of gestures: one finger swipe down to close an application and a one finger swipe up to open the menu (system or app, depending on the context).
I have a couple of questions:
1. Do I understand correctly that if I want to add the gestures, I have to copy config.def.h to config.h, make my changes, and build lisgd? There's no stand-alone config file?
2. Is it correct that I should build on the phone rather than my amd64 laptop to get an ARM build?
Sorry about the rudimentary issues. I haven't built anything from source for over a decade. It hasn't been necessary!
Thanks for trying it out - regarding changing swipe gestures, no official support but wouldn't be hard to hack in. Should be doable without compiling anything extra (unless you want to ofc : ) The program used for bindings gestures is called lisgd:
https://git.sr.ht/~mil/lisgd
You can see the default bindings for lisgd here:
https://git.sr.ht/~mil/lisgd/tree/master/config.def.h
Essentially what you'd want to do is create a script to bind your gestures.. If you use the `-g` option with lisgd atleast once, it will override any default (config.def.h) bindings referenced above. So you could create a script like (untested - but added the 2 commands for single up/down swipe you'd need) this - essentially just translating the config.h gestures to command line options and adding your extra gestures:
Code:
#!/usr/bin/env sh
pkill lisgd # E.g. because that's with the default bindings autostarted
lisgd \
-t 400 \
-g '1,u,d,sh -c "xdotool key --clearmodifiers Alt+Shift+c"' \
-g '1,d,u,sh -c "sxmo_appmenu.sh"' \
-g '1,l,r,sh -c "xdotool key --clearmodifiers Alt+Shift+e"' \
-g '1,r,l,sh -c "xdotool key --clearmodifiers Alt+Shift+r"' \
-g '2,l,r,sh -c "xdotool key --clearmodifiers Alt+e"' \
-g '2,r,l,sh -c "xdotool key --clearmodifiers Alt+r"' \
-g '2,d,u,sh -c "pidof svkbd-sxmo || svkbd-sxmo &"' \
-g '2,u,d,sh -c "pkill -9 svkbd-sxmo"' \
-g '3,d,u,sh -c "sxmo_vol.sh up"' \
-g '3,u,d,sh -c "sxmo_vol.sh down"' \
-g '4,d,u,sh -c "sxmo_brightness.sh up"' \
-g '4,u,d,sh -c "sxmo_brightness.sh down"'
And then run that script after you start up Sxmo / login. Not positive on the best way for a user-level change like that to persist - maybe in the future there will be a way to run a user xinit script on boot.