gate network/bluetooth/powerprofile processes on module enable flag

This commit is contained in:
Damocles 2026-04-17 00:57:18 +02:00
parent 25bc3954cb
commit 208a9023b8
3 changed files with 10 additions and 9 deletions

View file

@ -16,7 +16,7 @@ M.BarSection {
Process {
id: proc
running: true
running: M.Modules.network.enable
command: ["sh", "-c", "line=$(nmcli -t -f NAME,TYPE,DEVICE connection show --active 2>/dev/null | head -1); if [ -z \"$line\" ]; then dev=$(nmcli -t -f DEVICE,STATE device 2>/dev/null | grep ':connected' | grep -v ':unmanaged\\|:unavailable\\|:disconnected\\|:connecting' | head -1 | cut -d: -f1); [ -n \"$dev\" ] && line=\"linked:linked:$dev\"; fi; [ -z \"$line\" ] && exit 0; echo \"$line\"; dev=$(echo \"$line\" | cut -d: -f3); ip=$(nmcli -t -f IP4.ADDRESS device show \"$dev\" 2>/dev/null | head -1 | cut -d: -f2); echo \"ip:${ip:-}\"; sig=$(nmcli -t -f GENERAL.SIGNAL device show \"$dev\" 2>/dev/null | head -1 | cut -d: -f2); echo \"sig:${sig:-}\""]
stdout: StdioCollector {
onStreamFinished: {
@ -53,7 +53,7 @@ M.BarSection {
// Event-driven: re-poll on any network change
Process {
id: monitor
running: true
running: M.Modules.network.enable
command: ["nmcli", "monitor"]
stdout: SplitParser {
splitMarker: "\n"
@ -71,7 +71,7 @@ M.BarSection {
// Fallback poll
Timer {
interval: 60000
running: true
running: M.Modules.network.enable
repeat: true
onTriggered: proc.running = true
}