Files
bananarchy/overlay/rootfs/etc/NetworkManager/dispatcher.d/30-bananarchy-network-status.sh
T
Luxferre 608a8ac71b 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.
2026-11-08 09:28:13 +02:00

15 lines
602 B
Bash
Executable File

#!/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