Brightness indicator is not shown if brightness < 0

+ Tray moved to the very left.
This commit is contained in:
Sébastien Atoch 2025-07-31 12:18:18 -04:00
parent e85fafcd80
commit 1af0a084f8
2 changed files with 23 additions and 18 deletions

View file

@ -21,19 +21,24 @@ Item {
Process {
id: getBrightnessProcess
command: [Quickshell.shellDir + "/Programs/zigbrightness", "get", monitorName]
stdout: StdioCollector {
onStreamFinished: {
const output = this.text.trim()
const val = parseInt(output)
if (!isNaN(val) && val >= 0 && val !== previousBrightness) {
if (isNaN(val)) return
if (val < 0) {
brightnessDisplay.visible = false
}
else if (val >= 0 && val !== previousBrightness) {
brightnessDisplay.visible = true
previousBrightness = brightness
brightness = val
pill.text = brightness + "%"
if (firstChange) {
firstChange = false;
firstChange = false
}
else {
pill.show()