Files
bananarchy/overlay/rootfs/usr/bin/bananarchy-screen-wake.sh
T

12 lines
677 B
Bash
Raw Normal View History

#!/bin/sh
# Wake the screen for an external event (incoming call / SMS / notification)
# and reset dwm's idle-blank timer so it cannot blank again immediately.
export DISPLAY="${DISPLAY:-:0}"
# Cancel a pending idle-blank lock before the panel is powered on, so a wake
# does not race with the screenoff transition started by the blank handler.
"${BANANARCHY_IDLE_LOCK_HELPER:-/usr/bin/bananarchy-idle-lock.sh}" cancel >/dev/null 2>&1 || true
"${BANANARCHY_WM_CMD:-/usr/bin/sxmo_wm.sh}" display on >/dev/null 2>&1 || true
date +%s > /tmp/bananarchy_last_wake 2>/dev/null || true
p="$(pidof -s dwm 2>/dev/null || true)"
[ -n "$p" ] && kill -USR1 "$p" 2>/dev/null || true
exit 0