Replace idle network poller with event-driven dispatcher

A/B measure and reject additional VM/sysctl/mount tweaks that did not improve idle without trade-offs. Remove sxmo_networkmonitor's long-lived nmcli device monitor, replace it with NetworkManager dispatcher hooks that run Sxmo network/statusbar hooks as the X session user, disable the superd unit in both start hooks, guard it in check-rebuild.sh, update docs, rebuild the image, and verify live Wi-Fi reconnect and idle context switches.
This commit is contained in:
Luxferre committed 2026-11-08 09:28:13 +02:00
1 parent 3543556735
commit 608a8ac71b
11 files changed
+236 -7

No files matched your search

@@ -0,0 +1,14 @@
#!/bin/sh
# NetworkManager dispatcher: replace sxmo_networkmonitor's long-lived
# "nmcli device monitor" with event-driven Sxmo network/statusbar hooks.
# The helper re-executes as the X session user so status files stay owned by
# user:user. Double-fork so NetworkManager never waits for shell hooks.
case "${2:-}" in
up|down|pre-up|pre-down|vpn-up|vpn-down|vpn-pre-up|vpn-pre-down|\
connectivity-change|dhcp4-change|dhcp6-change|dns-change) ;;
*) exit 0 ;;
esac
( su user -s /bin/sh -c \
"/usr/bin/bananarchy-network-event.sh '$1' '$2'" \
>/dev/null 2>&1 & ) 2>/dev/null || true
exit 0
@@ -113,8 +113,11 @@ if [ -z "$SXMO_NO_MODEM" ] && command -v ModemManager > /dev/null; then
sxmo_wakelock.sh lock sxmo_modem_warming_up 120s
fi
# It watch network changes and update the status bar icon by example
superctl start sxmo_networkmonitor
# Network state changes are handled by the NetworkManager dispatcher
# (30-bananarchy-network-status.sh + bananarchy-network-event.sh), so no
# long-lived "nmcli device monitor" poller is started at idle. Disable the
# superd unit too, in case an older session enabled it.
superctl disable sxmo_networkmonitor >/dev/null 2>&1 || true
# The daemon that display notifications popup messages
superctl start sxmo_notificationmonitor