Added Network icon to bar and rework some of the debug prints

This commit is contained in:
Hannes
2026-02-16 20:34:56 +01:00
parent dac2760b32
commit b0c1bc7973
8 changed files with 96 additions and 12 deletions
+36 -6
View File
@@ -1,26 +1,56 @@
import QtQuick
import Quickshell
import Quickshell.Hyprland
// import Quickshell.Networking
import Quickshell.Io
MouseArea {
id: networkButton
width: 30
height: 28
width: output.width + 16
height: bar.height
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
// onClicked: {
// console.log("Wifi Hardware:", Networking.wifiHardwareEnabled)
// console.log("Wifi:", Networking.wifiEnabled)
// console.log("Device Type:", Networking.devices.DeviceType.toString(DeviceType))
// console.log("Device Type:", Networking.devices.DeviceConnectionState.toString(DeviceConnectionState)) // ???
// console.log("Device Type:", Networking.devices.toString(NetworkDevice))
// console.log("Device Type:", Networking.devices.length)
// }
Rectangle {
anchors.fill: parent
color: networkButton.containsMouse ? "#2a2a2a" : "transparent"
radius: 6
width: output.width + 16
Text {
id: output
anchors.centerIn: parent
text: "󰈀 "
font.pixelSize: 26
font.family: "Nerd Font"
color: "#ffffff"
color: output.text === "󰤭 /󱐤" ? "#FF0000" : "#00ff00"
}
Process {
id: networkStatus
command: ["sh", "-c", Quickshell.env("HOME") + "/.config/quickshell/modules/bar/scripts/Network.sh"]
running: true
stdout: StdioCollector {
onStreamFinished: {
output.text = this.text.trim()
console.log("networkScript output:", this.text.trim())
}
}
}
Timer {
interval: 10000
running: true
repeat: true
onTriggered: networkStatus.running = true
}
}
}