Files
bananarchy/overlay/rootfs/usr/bin/bananarchy-idle-timeout.sh
T
Luxferre 83c8db10f1 Release a1111 (lennon): isolate nokia-argon slider from 2720 Flip cover stack
- Write /usr/share/bananarchy/lid-profile per target in apply-bananarchy-overlay.sh (slider on nokia-argon, flip on nokia-beatles, none elsewhere), disable flip runlevel services, cover udev/config, and mux module loads on non-flip builds, and exit 0 immediately in flip daemons/init scripts when lid-profile != flip
- Guard startup Escape grab cleanup when locked and gate lid-state checks in display-power-sync, locker.so, and callscreen.so on lid-profile == flip so nokia-argon keeps pure a1108 sliding-lid behaviour
- Ship active-high shared cover backlight (kernel_backlight_invert = 0), active-black internal panel isolation (kernel_internal_sleep = 0), pixel-centered 240x240 cover UI, SW_LID hall sync, and shared Screen blank timeout on nokia-beatles
- Pin verified a1111 (lennon) image hashes for both nokia-argon and nokia-beatles and synchronize docs and host tests
2026-11-11 14:20:42 +02:00

74 lines
1.7 KiB
Bash
Executable File

#!/bin/sh
# Get or set the unlocked idle screen-blank timeout (seconds).
# Config menu -> "Screen blank" writes ~/.config/sxmo/idle_blank_timeout.
# 0 disables blanking; dwm reloads the file on SIGUSR1.
USER_HOME="${HOME:-/home/user}"
if [ "$(id -u)" -eq 0 ] && [ "$USER_HOME" = "/root" ] && [ -d /home/user ]; then
USER_HOME="/home/user"
fi
CFGDIR="${XDG_CONFIG_HOME:-$USER_HOME/.config}/sxmo"
CFG="$CFGDIR/idle_blank_timeout"
DEFAULT=300
get_secs() {
v="$DEFAULT"
if [ -r "$CFG" ]; then
read -r v < "$CFG" 2>/dev/null || v="$DEFAULT"
fi
case "$v" in ''|*[!0-9]*) v="$DEFAULT" ;; esac
printf '%s\n' "$v"
}
label() {
v="$(get_secs)"
if [ "$v" -le 0 ]; then
printf 'Off\n'
elif [ "$v" -lt 60 ]; then
printf '%ss\n' "$v"
elif [ $((v % 60)) -eq 0 ]; then
printf '%sm\n' "$((v / 60))"
else
printf '%sm%ss\n' "$((v / 60))" "$((v % 60))"
fi
}
notify_dwm() {
p="$(pidof -s dwm 2>/dev/null || true)"
[ -n "$p" ] && kill -USR1 "$p" 2>/dev/null || true
}
notify_cover() {
[ -x /usr/bin/bananarchy-coverctl ] && \
/usr/bin/bananarchy-coverctl REFRESH >/dev/null 2>&1 || true
}
case "${1:-get}" in
get)
get_secs
;;
label)
label
;;
set)
v="${2:-}"
case "$v" in ''|*[!0-9]*)
printf 'Usage: %s [get|label|set <seconds>]\n' "${0##*/}" >&2
exit 1
;;
esac
[ "$v" -le 86400 ] || v=86400
mkdir -p "$CFGDIR" 2>/dev/null || true
printf '%s\n' "$v" > "$CFG" || exit 1
if [ "$(id -u)" -eq 0 ] && [ "$USER_HOME" = "/home/user" ]; then
chown user:user "$CFGDIR" "$CFG" 2>/dev/null || true
fi
notify_dwm
notify_cover
printf '%s\n' "$v"
;;
*)
printf 'Usage: %s [get|label|set <seconds>]\n' "${0##*/}" >&2
exit 1
;;
esac