bluetooth and wifi

This commit is contained in:
end-4
2025-04-15 20:10:52 +02:00
parent ff8cee9dde
commit 62ef2fc421
13 changed files with 373 additions and 42 deletions
@@ -0,0 +1,53 @@
pragma Singleton
import Quickshell;
import Quickshell.Io;
import Quickshell.Services.Pipewire;
import QtQuick;
Singleton {
id: root
property int updateInterval: 1000
property string networkName: "";
property int networkStrength;
function update() {
updateNetworkName.running = true
updateNetworkStrength.running = true
}
Timer {
interval: 10
running: true
repeat: true
onTriggered: {
update()
interval = root.updateInterval;
}
}
Process {
id: updateNetworkName
command: ["sh", "-c", "nmcli -t -f NAME c show --active | head -1"]
running: true;
stdout: SplitParser {
onRead: data => {
root.networkName = data
// console.log("Network: " + data);
}
}
}
Process {
id: updateNetworkStrength
running: true
command: ["sh", "-c", "nmcli -f IN-USE,SIGNAL,SSID device wifi | awk '/^\*/{if (NR!=1) {print $2}}'"];
stdout: SplitParser {
onRead: data => {
root.networkStrength = parseInt(data);
// console.log("Network Strength: " + data);
}
}
}
}