Yeah these buttons have specific uses and this was set up so that the cursor
could be set back to where it needs to be as touchibg the menu moves the mouse
As acme is a mouse heavy program it needs input from middle and right clicks.
As such this requires xdotool to simulate mouse button clicks.
To make it work I have bound volume up to right click and volume down to middle
click.
There is also options in context menu as backup if the device doesn't have volume
controls.
If the mouse 2 and 3 aren't clear they require you to reselect the spot in less
than 2 seconds for the mouse click to occur at that location.
Signed-off-by: hazardchem <hazardchem@disroot.org>
---
configs/default_hooks/sxmo_hook_apps.sh | 1 +configs/default_hooks/sxmo_hook_contextmenu.sh | 13 +++++++++++++configs/default_hooks/sxmo_hook_inputhandler.sh | 12 ++++++++++++
3 files changed, 26 insertions(+)
diff --git a/configs/default_hooks/sxmo_hook_apps.sh b/configs/default_hooks/sxmo_hook_apps.sh
index ed3834d..43acd2b 100755
--- a/configs/default_hooks/sxmo_hook_apps.sh+++ b/configs/default_hooks/sxmo_hook_apps.sh
@@ -22,6 +22,7 @@ write_line_app() {
write_line_app gnome-2048 "$icon_gam 2048" "gnome-2048"
write_line_app jami-qt "$icon_msg Jami" "jami-qt"
+write_line_app acme "$icon_edt Acme" "acme -c 1 -f /usr/lib/plan9/font/pelm/ascii.16.font"
Would it be possible to avoid hard-coding this path? Sometimes
installation paths vary, so this could cause issues. Perhaps the package
for acme could provide a wrapper that points to the right file?
Besides that it would be nice to avoid calling xdotool directly for
wayland compatibility, but I don't think we have a good alternative on
wayland, so that's not really feasible yet.
nit: sometimes icons are unclear, perhaps this could be something like
"$icon_mse Middle click (2s delay)", does acme have specific terms it
uses for the mouse buttons?
+ $icon_itm Autocomplete ^ 0 ^ sxmo_type.sh -M Ctrl -k f+ $icon_exp Select Last Typed Text ^ 0 ^ sxmo_type.sh -M Escape+ $icon_del Delete To Start Of Line ^ 0 ^ sxmo_type.sh -M Ctrl -k U+ $icon_arl Move To Start Of Line ^ 0 ^ sxmo_type.sh -M Ctrl -k A+ $icon_arr Move To End Of Line ^ 0 ^ sxmo_type.sh -M Ctrl -k E+ "+ WINNAME=Acme+ ;; *)
# Default system menu (no matches)
CHOICES="
diff --git a/configs/default_hooks/sxmo_hook_inputhandler.sh b/configs/default_hooks/sxmo_hook_inputhandler.sh
index 848fecf..b0bba6d 100755
--- a/configs/default_hooks/sxmo_hook_inputhandler.sh+++ b/configs/default_hooks/sxmo_hook_inputhandler.sh
@@ -97,6 +97,18 @@ case "$WMCLASS" in
;;
esac
;;
+ *"acme"*)+ case "$ACTION" in+ "volup_one")+ xdotool click 3+ exit 0+ ;;+ "voldown_one")+ xdotool click 2+ exit 0+ ;;+ esac+ ;; *"foot"*|*"st"*|*"vte"*|"terminal") # Terminals
case "$WMCLASS" in # Handle programs without touch support
*"st"*)
--
2.44.0