sxmo: fix inputhandler hook loic errors

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

View File

@@ -35,8 +35,7 @@ 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
@@ -65,20 +64,19 @@ case "$STATE" in
handle_with sxmo_terminal.sh handle_with sxmo_terminal.sh
;; ;;
esac esac
;; fi
"lock"|"screenoff") if [ "$STATE" = "screenoff" ]; then
case "$ACTION" in case "$ACTION" in
"powerbutton_two") "powerbutton_two")
# power twice => toggle media player # power twice => toggle media player
handle_with playerctl play-pause handle_with playerctl play-pause
;; ;;
esac esac
;; fi
*) # default actions
# default actions case "$ACTION" in
case "$ACTION" in
"powerbutton_one") "powerbutton_one")
# power once => unlock # power once => unlock
handle_with sxmo_state_switch.sh set unlock handle_with sxmo_state_switch.sh set unlock
@@ -108,8 +106,7 @@ case "$STATE" in
"voldown_three") "voldown_three")
handle_with sxmo_audio.sh vol down "$VOL_INCR_3" handle_with sxmo_audio.sh vol down "$VOL_INCR_3"
;; ;;
esac
;;
esac esac
handle_with echo "no-op" handle_with echo "no-op"