From a7e8b39165632ac51fd01428d1f28b9939072b35 Mon Sep 17 00:00:00 2001 From: Sam Bowlby Date: Wed, 7 Apr 2021 10:28:33 -0500 Subject: [PATCH] add button actions. Use with my dwm patch fixed to pass shellcheck Signed-off-by: Maarten van Gompel --- scripts/core/sxmo_gesturehandler.sh | 34 +++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/scripts/core/sxmo_gesturehandler.sh b/scripts/core/sxmo_gesturehandler.sh index 0a80c91..d263dfe 100755 --- a/scripts/core/sxmo_gesturehandler.sh +++ b/scripts/core/sxmo_gesturehandler.sh @@ -125,6 +125,40 @@ if [ "$HANDLE" -ne 0 ]; then "back") xdotool key BackSpace ;; + "powerbutton_one") + if echo "$WMCLASS" | grep -i "megapixels"; then + xdotool key --clearmodifiers "space" + else + sxmo_keyboard.sh toggle + fi + ;; + "powerbutton_two") + sxmo_blinkled.sh blue && $TERMCMD -e "$SHELL" + ;; + "powerbutton_three") + sxmo_blinkled.sh blue && $BROWSER + ;; + "volup_one") + sxmo_appmenu.sh + ;; + "volup_two") + sxmo_appmenu.sh sys + ;; + "volup_three") + sxmo_lock.sh + ;; + "voldown_one") + xdotool key --clearmodifiers Alt+space + ;; + "voldown_two") + xdotool key --clearmodifiers Alt+Return + ;; + "voldown_three") + sxmo_blinkled.sh red && xdotool windowkill "$(xdotool getactivewindow)" + ;; + "voldown_four") + sxmo_blinkled.sh red & xdotool windowclose "$(xdotool getactivewindow)" + ;; *) #fallback, just execute the command "$@"