feat: show ethernet icon if ethernet is connected

Closes https://github.com/noctalia-dev/noctalia-shell/issues/115
This commit is contained in:
Kainoa Kanter 2025-08-22 12:34:08 -07:00
parent 8f951946ea
commit cd102d894e
No known key found for this signature in database
GPG key ID: 8703CACD01000000
2 changed files with 22 additions and 1 deletions

View file

@ -16,6 +16,7 @@ Singleton {
property string detectedInterface: ""
property string lastConnectedNetwork: ""
property bool isLoading: false
property bool ethernet: false
Component.onCompleted: {
Logger.log("Network", "Service started")
@ -43,6 +44,7 @@ Singleton {
function refreshNetworks() {
isLoading = true
checkEthernet.running = true
existingNetwork.running = true
}
@ -415,6 +417,24 @@ Singleton {
}
}
}
property Process checkEthernet: Process {
id: checkEthernet
running: false
command: ["nmcli", "-t", "-f", "DEVICE,TYPE,STATE", "device"]
stdout: StdioCollector {
onStreamFinished: {
var lines = text.split("\n")
for (var i = 0; i < lines.length; ++i) {
var parts = lines[i].split(":")
if (parts[1] === "ethernet" && parts[2] === "connected") {
root.ethernet = true
break
}
}
}
}
}
property Process addConnectionProcess: Process {
id: addConnectionProcess