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

@ -35,7 +35,7 @@ M.BarSection {
Process {
id: proc
running: true
running: M.Modules.bluetooth.enable
command: ["sh", "-c", "s=$(bluetoothctl show 2>/dev/null); " + "[ -z \"$s\" ] && echo unavailable && exit; " + "echo \"$s\" | grep -q 'Powered: yes' || { echo off:; exit; }; " + "info=$(bluetoothctl info 2>/dev/null); " + "d=$(echo \"$info\" | awk -F': ' '/\\tName:/{n=$2}/Connected: yes/{c=1}END{if(c)print n}'); " + "[ -n \"$d\" ] && echo \"connected:$d\" || { echo on:; exit; }; " + "bat=$(echo \"$info\" | awk -F': ' '/Battery Percentage.*\\(/{gsub(/[^0-9]/,\"\",$2);print $2}'); " + "[ -n \"$bat\" ] && echo \"bat:$bat\""]
stdout: StdioCollector {
onStreamFinished: root._parse(text)
@ -44,7 +44,7 @@ M.BarSection {
// Event-driven: watch BlueZ DBus property changes
Process {
id: btMonitor
running: true
running: M.Modules.bluetooth.enable
command: ["sh", "-c", "dbus-monitor --system \"interface='org.freedesktop.DBus.Properties',member='PropertiesChanged',path_namespace='/org/bluez'\" 2>/dev/null"]
stdout: SplitParser {
splitMarker: "\n"
@ -58,7 +58,7 @@ M.BarSection {
}
Timer {
interval: 60000
running: true
running: M.Modules.bluetooth.enable
repeat: true
onTriggered: proc.running = true
}