sxmo: fix inputhandler hook loic errors

This commit is contained in:
Colin 2023-09-23 09:36:16 +00:00
parent 07c3fd8941
commit 130901d7f7

View File

@ -35,81 +35,78 @@ handle_with() {
# - "lock" => display on but touchscreen disabled # - "lock" => display on but touchscreen disabled
# - "proximity{lock,unlock}" => intended for when in a phone call # - "proximity{lock,unlock}" => intended for when in a phone call
case "$STATE" in if [ "$STATE" = "unlock" ]; then
"unlock") case "$ACTION" in
case "$ACTION" in # powerbutton_one: intentional default to no-op
# powerbutton_one: intentional default to no-op # powerbutton_two: intentional default to screenoff
# powerbutton_two: intentional default to screenoff "powerbutton_three")
"powerbutton_three") # power thrice: kill active window
# power thrice: kill active window handle_with sxmo_killwindow.sh
handle_with sxmo_killwindow.sh ;;
;;
"volup_one") "volup_one")
# volume up once: app-specific menu w/ fallback to SXMO system menu # volume up once: app-specific menu w/ fallback to SXMO system menu
handle_with sxmo_appmenu.sh handle_with sxmo_appmenu.sh
;; ;;
# volup_two: intentionally defaulted for volume control # volup_two: intentionally defaulted for volume control
"volup_three") "volup_three")
# volume up thrice: DE menu # volume up thrice: DE menu
handle_with sxmo_wmmenu.sh handle_with sxmo_wmmenu.sh
;; ;;
"voldown_one") "voldown_one")
# volume down once: toggle keyboard # volume down once: toggle keyboard
handle_with sxmo_keyboard.sh toggle handle_with sxmo_keyboard.sh toggle
;; ;;
# voldown_two: intentionally defaulted for volume control # voldown_two: intentionally defaulted for volume control
"voldown_three") "voldown_three")
# volume down thrice: launch terminal # volume down thrice: launch terminal
handle_with sxmo_terminal.sh handle_with sxmo_terminal.sh
;; ;;
esac esac
fi
if [ "$STATE" = "screenoff" ]; then
case "$ACTION" in
"powerbutton_two")
# power twice => toggle media player
handle_with playerctl play-pause
;;
esac
fi
# default actions
case "$ACTION" in
"powerbutton_one")
# power once => unlock
handle_with sxmo_state_switch.sh set unlock
;;
"powerbutton_two")
# power twice => screenoff
handle_with sxmo_state_switch.sh set screenoff
;;
# powerbutton_three: intentional no-op because overloading the kill-window handler is risky
"volup_one")
handle_with sxmo_audio.sh vol up "$VOL_INCR_1"
;;
"volup_two")
handle_with sxmo_audio.sh vol up "$VOL_INCR_2"
;;
"volup_three")
handle_with sxmo_audio.sh vol up "$VOL_INCR_3"
;; ;;
"lock"|"screenoff") "voldown_one")
case "$ACTION" in handle_with sxmo_audio.sh vol down "$VOL_INCR_1"
"powerbutton_two")
# power twice => toggle media player
handle_with playerctl play-pause
;;
esac
;; ;;
"voldown_two")
*) handle_with sxmo_audio.sh vol down "$VOL_INCR_2"
# default actions ;;
case "$ACTION" in "voldown_three")
"powerbutton_one") handle_with sxmo_audio.sh vol down "$VOL_INCR_3"
# power once => unlock
handle_with sxmo_state_switch.sh set unlock
;;
"powerbutton_two")
# power twice => screenoff
handle_with sxmo_state_switch.sh set screenoff
;;
# powerbutton_three: intentional no-op because overloading the kill-window handler is risky
"volup_one")
handle_with sxmo_audio.sh vol up "$VOL_INCR_1"
;;
"volup_two")
handle_with sxmo_audio.sh vol up "$VOL_INCR_2"
;;
"volup_three")
handle_with sxmo_audio.sh vol up "$VOL_INCR_3"
;;
"voldown_one")
handle_with sxmo_audio.sh vol down "$VOL_INCR_1"
;;
"voldown_two")
handle_with sxmo_audio.sh vol down "$VOL_INCR_2"
;;
"voldown_three")
handle_with sxmo_audio.sh vol down "$VOL_INCR_3"
;;
esac
;; ;;
esac esac
handle_with echo "no-op" handle_with echo "no-op"