Renamed sxmo_gesturehandler.sh to sxmo_inputhandler.sh (after Sam Bowly's patches), renamed gesture hook to inputhandler hook. Removed hotcorner script and powerbutton scripts and their hooks (now all handled by inputhandler and its hook).

master
Maarten van Gompel 4 years ago
parent a7e8b39165
commit 21379b7914
  1. 25
      scripts/core/sxmo_hotcorner.sh
  2. 20
      scripts/core/sxmo_inputhandler.sh
  3. 50
      scripts/core/sxmo_lisgdstart.sh
  4. 17
      scripts/core/sxmo_powerbutton.sh

@ -1,25 +0,0 @@
#!/usr/bin/env sh
if [ -z "$1" ]; then
exit 1
else
CORNER="$1"
fi
if [ -x "$XDG_CONFIG_HOME/sxmo/hooks/hotcorner_$CORNER" ]; then
"$XDG_CONFIG_HOME/sxmo/hooks/hotcorner_$CORNER"
exit $?
fi
case "$CORNER" in
"topleft")
sxmo_appmenu.sh sys &
;;
"topright")
;;
"bottomleft")
sxmo_lock.sh &
;;
"bottomright")
sxmo_rotate.sh &
;;
esac

@ -1,5 +1,8 @@
#!/usr/bin/env sh
# This script handles input actions, it is called by lisgd for gestures
# and by dwm for button presses
ACTION="$1"
# include common definitions
@ -10,9 +13,9 @@ XPROPOUT="$(xprop -id "$(xdotool getactivewindow)")"
WMCLASS="$(echo "$XPROPOUT" | grep WM_CLASS | cut -d ' ' -f3- | cut -d ' ' -f1 | tr -d '\",')"
HANDLE=1
if [ -x "$XDG_CONFIG_HOME"/sxmo/hooks/gesture ]; then
if [ -x "$XDG_CONFIG_HOME"/sxmo/hooks/inputhandler ]; then
#hook script must exit with a zero exit code ONLY if it has handled the gesture!
"$XDG_CONFIG_HOME"/sxmo/hooks/gesture "$WMCLASS" "$@"
"$XDG_CONFIG_HOME"/sxmo/hooks/inputhandler "$WMCLASS" "$@"
HANDLE=$?
fi
@ -151,7 +154,7 @@ if [ "$HANDLE" -ne 0 ]; then
xdotool key --clearmodifiers Alt+space
;;
"voldown_two")
xdotool key --clearmodifiers Alt+Return
xdotool key --clearmodifiers Alt+Return
;;
"voldown_three")
sxmo_blinkled.sh red && xdotool windowkill "$(xdotool getactivewindow)"
@ -159,6 +162,17 @@ if [ "$HANDLE" -ne 0 ]; then
"voldown_four")
sxmo_blinkled.sh red & xdotool windowclose "$(xdotool getactivewindow)"
;;
"topleftcorner")
sxmo_appmenu.sh sys &
;;
"toprightcorner")
;;
"bottomleftcorner")
sxmo_lock.sh &
;;
"bottomrightcorner")
sxmo_rotate.sh &
;;
*)
#fallback, just execute the command
"$@"

@ -20,30 +20,30 @@ else
# fingers,swipe,edge,distance,command
#order matters, only the first match gets executed
lisgd "$@" -t "$LISGD_THRESHOLD" -T "$LISGD_THRESHOLD_PRESSED" \
-g '1,DRUL,BR,*,sxmo_hotcorner.sh bottomright' \
-g '1,DLUR,BL,*,sxmo_hotcorner.sh bottomleft' \
-g '1,ULDR,TL,*,sxmo_hotcorner.sh topleft' \
-g '1,URDL,TR,*,sxmo_hotcorner.sh topright' \
-g '1,LR,B,L,sxmo_gesturehandler.sh enter' \
-g '1,RL,B,L,sxmo_gesturehandler.sh back' \
-g '1,LR,L,*,sxmo_gesturehandler.sh prevdesktop' \
-g '1,RL,R,*,sxmo_gesturehandler.sh nextdesktop' \
-g '1,DU,L,*,P,sxmo_gesturehandler.sh volup' \
-g '1,UD,L,*,P,sxmo_gesturehandler.sh voldown' \
-g '1,LR,T,*,P,sxmo_gesturehandler.sh brightnessup' \
-g '1,RL,T,*,P,sxmo_gesturehandler.sh brightnessdown' \
-g "1,DU,B,*,sxmo_gesturehandler.sh showkeyboard" \
-g "1,UD,B,*,sxmo_gesturehandler.sh hidekeyboard" \
-g "1,UD,T,*,sxmo_gesturehandler.sh showmenu" \
-g "1,DU,T,*,sxmo_gesturehandler.sh hidemenu" \
-g "2,UD,T,*,sxmo_gesturehandler.sh showsysmenu" \
-g "2,UD,B,*,sxmo_gesturehandler.sh closewindow" \
-g "3,UD,B,*,sxmo_gesturehandler.sh killwindow" \
-g '2,RL,*,*,sxmo_gesturehandler.sh moveprevdesktop' \
-g '2,LR,*,*,sxmo_gesturehandler.sh movenextdesktop' \
-g '1,DU,R,*,P,sxmo_gesturehandler.sh scrollup_short' \
-g '1,UD,R,*,P,sxmo_gesturehandler.sh scrolldown_short' \
-g '1,LR,R,S,sxmo_gesturehandler.sh scrollright_short' \
-g '1,RL,L,S,sxmo_gesturehandler.sh scrollleft_short' \
-g '1,DRUL,BR,*,sxmo_inputhandler.sh bottomrightcorner' \
-g '1,DLUR,BL,*,sxmo_inputhandler.sh bottomleftcorner' \
-g '1,ULDR,TL,*,sxmo_inputhandler.sh topleftcorner' \
-g '1,URDL,TR,*,sxmo_inputhandler.sh toprightcorner' \
-g '1,LR,B,L,sxmo_inputhandler.sh enter' \
-g '1,RL,B,L,sxmo_inputhandler.sh back' \
-g '1,LR,L,*,sxmo_inputhandler.sh prevdesktop' \
-g '1,RL,R,*,sxmo_inputhandler.sh nextdesktop' \
-g '1,DU,L,*,P,sxmo_inputhandler.sh volup' \
-g '1,UD,L,*,P,sxmo_inputhandler.sh voldown' \
-g '1,LR,T,*,P,sxmo_inputhandler.sh brightnessup' \
-g '1,RL,T,*,P,sxmo_inputhandler.sh brightnessdown' \
-g "1,DU,B,*,sxmo_inputhandler.sh showkeyboard" \
-g "1,UD,B,*,sxmo_inputhandler.sh hidekeyboard" \
-g "1,UD,T,*,sxmo_inputhandler.sh showmenu" \
-g "1,DU,T,*,sxmo_inputhandler.sh hidemenu" \
-g "2,UD,T,*,sxmo_inputhandler.sh showsysmenu" \
-g "2,UD,B,*,sxmo_inputhandler.sh closewindow" \
-g "3,UD,B,*,sxmo_inputhandler.sh killwindow" \
-g '2,RL,*,*,sxmo_inputhandler.sh moveprevdesktop' \
-g '2,LR,*,*,sxmo_inputhandler.sh movenextdesktop' \
-g '1,DU,R,*,P,sxmo_inputhandler.sh scrollup_short' \
-g '1,UD,R,*,P,sxmo_inputhandler.sh scrolldown_short' \
-g '1,LR,R,S,sxmo_inputhandler.sh scrollright_short' \
-g '1,RL,L,S,sxmo_inputhandler.sh scrollleft_short' \
&
fi

@ -1,17 +0,0 @@
#!/usr/bin/env sh
# include common definitions
# shellcheck source=scripts/core/sxmo_common.sh
. "$(dirname "$0")/sxmo_common.sh"
if [ -x "$XDG_CONFIG_HOME/sxmo/hooks/powerbutton" ]; then
"$XDG_CONFIG_HOME/sxmo/hooks/powerbutton"
else
XPROPOUT="$(xprop -id "$(xdotool getactivewindow)")"
WMCLASS="${1:-$(echo "$XPROPOUT" | grep WM_CLASS | cut -d ' ' -f3-)}"
if echo "$WMCLASS" | grep -i "megapixels"; then
xdotool key --clearmodifiers "space"
else
sxmo_keyboard.sh toggle
fi
fi
Loading…
Cancel
Save