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
This commit is contained in:
Luxferre committed 2026-11-11 14:20:42 +02:00
1 parent 7a2b965ce3
commit 83c8db10f1
38 files changed
+1351 -276

No files matched your search

Binary file not shown.
@@ -1,8 +1,9 @@
#!/bin/sh
# Keep DRM DPMS and the schedutil rate limit in sync with the backlight state.
# Invoked by the backlight udev rule (as root) and by sxmo_wm.sh display on
# (via doas). The 2720 Flip shares one PWM backlight between both panels:
# it is active-low for the cover and active-high for the main panel.
# (via doas). The 2720 Flip shares one active-high PMIC MPP2 PWM backlight
# between both panels; /run/bananarchy/cover-backlight marks cover ownership
# ("0" = preparing GRAM with backlight dark, "1" = cover lit).
#
# The daemon calls this helper with "force" only on a real cover-state
# transition. Plain udev events are idempotent and must never toggle bl_power,
@@ -16,10 +17,12 @@ RL_PATH=/sys/devices/system/cpu/cpufreq/schedutil/rate_limit_us
COVER_MARKER=/run/bananarchy/cover-backlight
FORCE_MARKER=/run/bananarchy/cover-bl-force
STATE_CACHE=/run/bananarchy/cover-power-state
LID_PROFILE="${BANANARCHY_LID_PROFILE:-/usr/share/bananarchy/lid-profile}"
LID_STATE=/run/bananarchy/lid-state
CONF=/etc/bananarchy/cover-display.conf
RUNTIME_CONF=/run/bananarchy/cover-runtime.conf
COVER_BL_LEVEL=14
COVER_BL_INVERT=1
COVER_BL_INVERT=0
FORCE=0
[ "${1:-}" = "force" ] && FORCE=1
@@ -29,12 +32,14 @@ if [ "$FORCE" -eq 0 ] && [ -f "$FORCE_MARKER" ]; then
exit 0
fi
if [ -r "$CONF" ]; then
_level=$(awk -F= '/^[[:space:]]*kernel_backlight_level[[:space:]]*=/ {gsub(/[[:space:]]/, "", $2); print $2; exit}' "$CONF" 2>/dev/null)
case "${_level:-}" in ''|*[!0-9]*) ;; *) COVER_BL_LEVEL="$_level" ;; esac
_invert=$(awk -F= '/^[[:space:]]*kernel_backlight_invert[[:space:]]*=/ {gsub(/[[:space:]]/, "", $2); print $2; exit}' "$CONF" 2>/dev/null)
case "${_invert:-}" in 0|1) COVER_BL_INVERT="$_invert" ;; esac
fi
for _cfg in "$CONF" "$RUNTIME_CONF"; do
if [ -r "$_cfg" ]; then
_level=$(awk -F= '/^[[:space:]]*kernel_backlight_level[[:space:]]*=/ {gsub(/[[:space:]]/, "", $2); print $2; exit}' "$_cfg" 2>/dev/null)
case "${_level:-}" in ''|*[!0-9]*) ;; *) COVER_BL_LEVEL="$_level" ;; esac
_invert=$(awk -F= '/^[[:space:]]*kernel_backlight_invert[[:space:]]*=/ {gsub(/[[:space:]]/, "", $2); print $2; exit}' "$_cfg" 2>/dev/null)
case "${_invert:-}" in 0|1) COVER_BL_INVERT="$_invert" ;; esac
fi
done
DPMS_PATH=
for _dpms in /sys/class/drm/card*-*/dpms; do
@@ -44,7 +49,9 @@ done
read_value() {
_path="$1"
_value=""
[ -r "$_path" ] && { read -r _value < "$_path" 2>/dev/null || _value=""; }
if [ -r "$_path" ]; then
IFS= read -r _value < "$_path" 2>/dev/null || [ -n "$_value" ] || _value=""
fi
printf '%s' "$_value"
}
@@ -69,20 +76,37 @@ force_dpms() {
br="$(read_value "$BR_PATH")"
case "$br" in ''|*[!0-9]*) br=1 ;; esac
# Non-flip devices (e.g. nokia-argon slider) have a single panel with no cover
# display or shared backlight: sync DRM DPMS and schedutil directly.
if [ "$(read_value "$LID_PROFILE")" != "flip" ]; then
if [ "$br" -eq 0 ]; then
force_dpms "Off"
else
force_dpms "On"
if [ -w "$RL_PATH" ]; then
printf '40000\n' > "$RL_PATH" 2>/dev/null || true
fi
fi
exit 0
fi
blp="$(read_value "$BL_POWER_PATH")"
lid="$(read_value "$LID_STATE")"
HAD_MARKER=0
marker=""
[ -r "$COVER_MARKER" ] && marker="$(read_value "$COVER_MARKER")"
if [ -e "$COVER_MARKER" ]; then
HAD_MARKER=1
[ -r "$COVER_MARKER" ] && marker="$(read_value "$COVER_MARKER")"
fi
if [ "$COVER_BL_INVERT" -eq 1 ]; then
LIT_BR=0
DARK_BR="$COVER_BL_LEVEL"
DARK_BLP=0
else
LIT_BR="$COVER_BL_LEVEL"
DARK_BR=0
DARK_BLP=4
fi
DARK_BR=0
DARK_BLP=4
DESIRED_BR="$br"
DESIRED_BLP="$blp"
@@ -91,27 +115,46 @@ DESIRED_KBD=""
DESIRED_KEY="normal"
if [ "$lid" = "open" ]; then
DESIRED_KEY="open:$COVER_BL_LEVEL:0:On:absent:$COVER_BL_INVERT"
DESIRED_BR="$COVER_BL_LEVEL"
rm -f "$COVER_MARKER" 2>/dev/null || true
if [ "$FORCE" -eq 1 ] || [ "$HAD_MARKER" -eq 1 ]; then
OPEN_BR="$br"
[ "$OPEN_BR" -gt 0 ] 2>/dev/null || OPEN_BR="$COVER_BL_LEVEL"
DESIRED_KEY="open:$OPEN_BR:0:On:absent:$COVER_BL_INVERT"
DESIRED_BR="$OPEN_BR"
DESIRED_BLP="0"
DESIRED_DPMS="On"
elif [ "$br" -eq 0 ]; then
DESIRED_BR="0"
DESIRED_BLP="4"
DESIRED_DPMS="Off"
DESIRED_KEY="open:0:4:Off:absent:$COVER_BL_INVERT"
else
DESIRED_BLP="0"
DESIRED_DPMS="On"
DESIRED_KEY="open:$br:0:On:absent:$COVER_BL_INVERT"
fi
elif [ "$marker" = "1" ]; then
DESIRED_KEY="lit:$LIT_BR:0:On:1:$COVER_BL_INVERT"
DESIRED_BR="$LIT_BR"
DESIRED_BLP="0"
DESIRED_DPMS="On"
rm -f "$COVER_MARKER" 2>/dev/null || true
elif [ -f "$COVER_MARKER" ]; then
DESIRED_KBD="0"
elif [ "$marker" = "0" ]; then
DESIRED_KEY="prep:$DARK_BR:$DARK_BLP:On:0:$COVER_BL_INVERT"
DESIRED_BR="$DARK_BR"
DESIRED_BLP="$DARK_BLP"
DESIRED_DPMS="On"
if [ "$marker" = "1" ]; then
DESIRED_KEY="lit:$LIT_BR:0:On:1:$COVER_BL_INVERT"
DESIRED_BR="$LIT_BR"
DESIRED_BLP="0"
else
DESIRED_KEY="dark:$DARK_BR:$DARK_BLP:On:0:$COVER_BL_INVERT"
DESIRED_BR="$DARK_BR"
DESIRED_BLP="$DARK_BLP"
fi
DESIRED_KBD="0"
elif [ "$lid" = "closed" ]; then
DESIRED_KEY="dark:$DARK_BR:$DARK_BLP:Off:absent:$COVER_BL_INVERT"
DESIRED_BR="$DARK_BR"
DESIRED_BLP="$DARK_BLP"
DESIRED_DPMS="Off"
DESIRED_KBD="0"
elif ! "${BANANARCHY_LID_GATE:-/usr/bin/bananarchy-lid-gate.sh}"; then
DESIRED_KEY="closed:0:4:Off:absent:$COVER_BL_INVERT"
DESIRED_BR="0"
DESIRED_BLP="4"
DESIRED_KEY="closed:$DARK_BR:$DARK_BLP:Off:absent:$COVER_BL_INVERT"
DESIRED_BR="$DARK_BR"
DESIRED_BLP="$DARK_BLP"
DESIRED_DPMS="Off"
DESIRED_KBD="0"
else
@@ -124,9 +167,9 @@ if [ "$FORCE" -eq 1 ]; then
printf '1\n' > "$FORCE_MARKER" 2>/dev/null || true
trap cleanup_force EXIT INT TERM HUP
set_if_changed "$BL_POWER_PATH" "4"
set_if_changed "$BR_PATH" "$DESIRED_BR"
printf '%s\n' "$DESIRED_BR" > "$BR_PATH" 2>/dev/null || true
set_if_changed "$BL_POWER_PATH" "$DESIRED_BLP"
set_if_changed "$BR_PATH" "$DESIRED_BR"
printf '%s\n' "$DESIRED_BR" > "$BR_PATH" 2>/dev/null || true
else
set_if_changed "$BL_POWER_PATH" "$DESIRED_BLP"
set_if_changed "$BR_PATH" "$DESIRED_BR"
@@ -2,7 +2,11 @@
# 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.
CFGDIR="${XDG_CONFIG_HOME:-${HOME:-/home/user}/.config}/sxmo"
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
@@ -33,6 +37,11 @@ notify_dwm() {
[ -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
@@ -50,7 +59,11 @@ case "${1:-get}" in
[ "$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"
;;
*)
Binary file not shown.
Binary file not shown.
@@ -189,14 +189,16 @@ fi
# A cold boot can leave the resident dmenu or xlocker plugin holding an X
# keyboard grab before the user sees the desktop. Release both once after
# dwm has started; do not keep a background poller alive.
# dwm has started when booting unlocked; do not keep a background poller alive.
(
sleep 3
/usr/bin/dwm-plugin dmenu close >/dev/null 2>&1 || true
if [ -p /tmp/dwm_plugin_locker.fifo ]; then
printf "CLOSE\n" > /tmp/dwm_plugin_locker.fifo 2>/dev/null || true
if [ ! -f /tmp/bananarchy_screen_locked ]; then
/usr/bin/dwm-plugin dmenu close >/dev/null 2>&1 || true
if [ -p /tmp/dwm_plugin_locker.fifo ]; then
printf "CLOSE\n" > /tmp/dwm_plugin_locker.fifo 2>/dev/null || true
fi
xdotool key --clearmodifiers Escape >/dev/null 2>&1 || true
fi
xdotool key --clearmodifiers Escape >/dev/null 2>&1 || true
) &
first_iter=1
+4 -4
View File
@@ -27,16 +27,16 @@ transition() {
if [ "$state" = "unlock" ] && [ -f /tmp/bananarchy_screen_locked ]; then
state="lock"
printf '%s\n' "$state" > "$SXMO_STATE"
sxmo_wm.sh display on >/dev/null 2>&1 &
xlocker wake >/dev/null 2>&1 &
sxmo_wm.sh display on 3<&- >/dev/null 2>&1 &
xlocker wake 3<&- >/dev/null 2>&1 &
return 0
fi
if [ "$state" = "lock" ]; then
printf '1\n' > /tmp/bananarchy_screen_locked
xlocker >/dev/null 2>&1 &
xlocker 3<&- >/dev/null 2>&1 &
elif [ "$state" = "screenoff" ]; then
printf '1\n' > /tmp/bananarchy_screen_locked
xlocker screenoff >/dev/null 2>&1 &
xlocker screenoff 3<&- >/dev/null 2>&1 &
fi
sxmo_log "transitioning to stage $state"
+15 -3
View File
@@ -31,6 +31,21 @@ swi3msg() {
xorgdisplay() {
case "$1" in
off)
if [ -w /sys/class/leds/white:kbd_backlight/brightness ]; then
printf '0\n' > /sys/class/leds/white:kbd_backlight/brightness 2>/dev/null || true
fi
_cover_lit=""
if [ -r /run/bananarchy/cover-backlight ]; then
read -r _cover_lit < /run/bananarchy/cover-backlight 2>/dev/null || _cover_lit=""
fi
if { [ "$_cover_lit" = "1" ] || [ "$_cover_lit" = "0" ]; } && \
! "${BANANARCHY_LID_GATE:-/usr/bin/bananarchy-lid-gate.sh}"; then
if [ -w /sys/devices/system/cpu/cpufreq/policy0/scaling_governor ]; then
printf 'powersave\n' > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor 2>/dev/null || true
fi
/usr/bin/bananarchy-power-policy.sh screenoff >/dev/null 2>&1 &
return 0
fi
if [ -r /sys/class/backlight/backlight/brightness ]; then
_cur_bl=0
read -r _cur_bl < /sys/class/backlight/backlight/brightness 2>/dev/null || true
@@ -40,9 +55,6 @@ xorgdisplay() {
printf '%s\n' "$_cur_bl" > "${XDG_CONFIG_HOME:-$HOME/.config}/sxmo/brightness" 2>/dev/null || true
fi
fi
if [ -w /sys/class/leds/white:kbd_backlight/brightness ]; then
printf '0\n' > /sys/class/leds/white:kbd_backlight/brightness 2>/dev/null || true
fi
if [ -w /sys/class/backlight/backlight/brightness ]; then
printf '0\n' > /sys/class/backlight/backlight/brightness 2>/dev/null || true
fi