2026-11-09 22:50:51 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
# Bridge Sxmo hooks to the cover display daemon. Safe no-op on non-flip
|
|
|
|
|
# devices and when the daemon is not running.
|
|
|
|
|
set -u
|
|
|
|
|
EVENT="${1:-refresh}"
|
|
|
|
|
shift 2>/dev/null || true
|
|
|
|
|
[ "$(cat /usr/share/bananarchy/lid-profile 2>/dev/null)" = "flip" ] || exit 0
|
|
|
|
|
case "$EVENT" in
|
|
|
|
|
notification)
|
|
|
|
|
/usr/bin/bananarchy-coverctl NOTIFY "Notification" >/dev/null 2>&1 || true
|
|
|
|
|
;;
|
|
|
|
|
ring)
|
|
|
|
|
/usr/bin/bananarchy-coverctl CALL incoming "${1:--}" "-" >/dev/null 2>&1 || true
|
|
|
|
|
;;
|
|
|
|
|
missed)
|
|
|
|
|
/usr/bin/bananarchy-coverctl CALL missed "${1:--}" "-" >/dev/null 2>&1 || true
|
|
|
|
|
;;
|
|
|
|
|
call|active)
|
|
|
|
|
/usr/bin/bananarchy-coverctl CALL active "${1:--}" "-" >/dev/null 2>&1 || true
|
|
|
|
|
;;
|
|
|
|
|
hangup|ended)
|
|
|
|
|
/usr/bin/bananarchy-coverctl CALL none "-" "-" >/dev/null 2>&1 || true
|
|
|
|
|
;;
|
|
|
|
|
sms)
|
|
|
|
|
/usr/bin/bananarchy-coverctl SMS "${1:-1}" >/dev/null 2>&1 || true
|
|
|
|
|
;;
|
|
|
|
|
screenoff)
|
|
|
|
|
/usr/bin/bananarchy-coverctl REFRESH >/dev/null 2>&1 || true
|
|
|
|
|
;;
|
2026-11-10 13:23:03 +02:00
|
|
|
network)
|
|
|
|
|
/usr/bin/bananarchy-cover-status.sh >/dev/null 2>&1 || true
|
|
|
|
|
;;
|
|
|
|
|
button)
|
|
|
|
|
# Trusted external side-button wake (also sent directly by
|
|
|
|
|
# bananarchy-volume-keys when the flip is closed).
|
|
|
|
|
/usr/bin/bananarchy-coverctl BUTTON >/dev/null 2>&1 || true
|
|
|
|
|
;;
|
2026-11-10 20:23:06 +02:00
|
|
|
wake)
|
|
|
|
|
# Every blocked main-panel wake request is forwarded here by the lid gate.
|
|
|
|
|
/usr/bin/bananarchy-coverctl WAKE >/dev/null 2>&1 || true
|
|
|
|
|
;;
|
|
|
|
|
refresh|theme)
|
2026-11-09 22:50:51 +02:00
|
|
|
/usr/bin/bananarchy-coverctl RELOAD_THEME >/dev/null 2>&1 || true
|
|
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
/usr/bin/bananarchy-coverctl REFRESH >/dev/null 2>&1 || true
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
exit 0
|