bar/modules/Network.qml (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
// Sunset.qml
import QtQuick
import Quickshell
import Quickshell.Io
import QtQuick.Layouts
import "../../"
import "../classes" as Class
Class.RightRowLayout {
Class.TopbarText {
id: network_name
Process {
id: network_name_script
command: ["iwgetid","-r"]
workingDirectory: Quickshell.shellDir
running: true
stdout: StdioCollector {
onStreamFinished: network_name.text = this.text.trim()
}
}
Timer {
interval: 1000
running: true
repeat: true
onTriggered: network_name_script.running = true
}
}
Class.TopbarIcon {
id: wifi_strength
font.pixelSize: 9
Process {
id: wifi_strength_script
command: ["bar/scripts/wifi_strength.sh"]
workingDirectory: Quickshell.shellDir
running: true
stdout: StdioCollector {
// onStreamFinished: wifi_strength.text = Icons.network.bar0
onStreamFinished: wifi_strength.text = Icons.network.bar[this.text]
}
}
Timer {
interval: 1000
running: true
repeat: true
onTriggered: wifi_strength_script.running = true
}
}
}
|