this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

add simple battery status in quickshell

+43 -1
+23
home/quickshell/qml/Bar/Modules/SystemInfo.qml
··· 78 78 verticalAlignment: Text.AlignVCenter 79 79 } 80 80 } 81 + 82 + // Battery Status Component 83 + Row { 84 + id: batteryStatusLayout 85 + spacing: 3 86 + Text { 87 + font.family: "Material Symbols Outlined" 88 + font.pixelSize: Theme.fontSizeBody 89 + text: "battery_full" 90 + color: Theme.accentPrimary 91 + verticalAlignment: Text.AlignVCenter 92 + anchors.verticalCenter: parent.verticalCenter 93 + } 94 + 95 + Text { 96 + font.family: Theme.fontFamily 97 + font.pixelSize: Theme.fontSizeSmall 98 + color: Theme.textPrimary 99 + text: Sysinfo.batteryStatusStr 100 + anchors.verticalCenter: parent.verticalCenter 101 + verticalAlignment: Text.AlignVCenter 102 + } 103 + } 81 104 }
+20 -1
home/quickshell/qml/Services/Sysinfo.qml
··· 13 13 property string cpuTempStr: "" 14 14 property string memoryUsageStr: "" 15 15 property string memoryUsagePerStr: "" 16 + property string batteryStatusStr: "" 16 17 property real cpuUsage: 0 17 18 property real memoryUsage: 0 18 19 property real cpuTemp: 0 ··· 44 45 } 45 46 } 46 47 } 47 - } 48 + 49 + Process { 50 + id: batteryProcess 51 + running: true 52 + command: ["upower", "-i", "/org/freedesktop/UPower/devices/battery_BAT0"] 53 + stdout: SplitParser { 54 + onRead: function (line) { 55 + try { 56 + const usageMatch = line.match(/percentage:\s+(\d+)%/); 57 + if (usageMatch) { 58 + batteryStatusStr = usageMatch[1] + "%"; 59 + } 60 + } catch (e) { 61 + console.error("Failed to parse battery output:", e); 62 + } 63 + } 64 + } 65 + } 66 + }