dotfiles bugabingas dorkfiles
owned by bugabinga
README Source History Refs Compare Notes Search feat(system): battery charge/state, bigger sparklines, themed action buttons ef0b0f49e16b69153fd8df4c8b02a320164f05d3
Oliver Jan Krylow <oliver@bugabinga.net > · 28 Jun 2026
unsigned
Browse files Compare with HEAD
- Battery row now shows live charge % + state (charging/full/on battery),
appending wear % only when supported — instead of a bare "health n/a".
- Fix UPower scale: percentage/healthPercentage are 0..1 fractions; scale
to 0..100 at the Resources boundary so the view reads "100%" not "1%"
and the detectIssues health<80 check stops false-firing on healthy packs.
- Expose battery percent/status in stateJson() (IPC truthfulness).
- Sparklines widened 60->104 and 16->22px so the trend reads at a glance.
- Issue action buttons restyled as ghost buttons (transparent, severity
border + text, faint hover fill) to match the dark card theme.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Changed files (2) quickshell/nuguland/PopoutHost.qml Modified 808 808 if (
! systemPanel.rs)
811 + const p
= systemPanel.rs.batteryPercent;
812 + const st
= systemPanel.rs.batteryStatus;
811 813 const h
= systemPanel.rs.healthPercentage;
812 - return (h
=== null || h
=== undefined )
? "battery health n/a" : `battery health ${
Math .
round (
Number (h))}
%` ;
814 + let s
= (p
=== null || p
=== undefined )
? "battery n/a" : `battery ${p}
%` ;
817 + if (h
!== null && h
!== undefined )
818 + s
+= ` · health ${
Math .
round (
Number (h))}
%` ;
1087 1094 visible:
!! issueCard.modelData.action
1088 1095 anchors.right: parent.right
1089 - anchors.rightMargin:
10 1096 + anchors.rightMargin:
12 1090 1097 anchors.verticalCenter: parent.verticalCenter
1094 - color: root.theme
? root.theme.withAlpha(issueCard.sevColor,
0.30 )
: "transparent" 1103 + color: actMouse.containsMouse
&& root.theme
? root.theme.withAlpha(issueCard.sevColor,
0.22 )
: "transparent" 1105 + border.color: root.theme
? root.theme.withAlpha(issueCard.sevColor,
0.55 )
: issueCard.sevColor
1097 1108 anchors.centerIn: parent
1110 + color : issueCard.sevColor
1111 + font.family:
"IBM Plex Sans" 1112 + font.pixelSize:
13 1104 1118 anchors.fill: parent
1119 + hoverEnabled :
true 1105 1120 cursorShape :
Qt .PointingHandCursor
1107 1122 if (systemPanel.rs)
1452 1467 values: mrow.ring
1453 1468 scaleMax: mrow.sparkScaleMax
1454 1469 barColor: mrow.barColor
quickshell/nuguland/Resources.qml Modified 4 + import Quickshell.Services.UPower
4 5 import "sysinfo.js" as Sys 80 83 readonly property var healthPercentage: {
81 84 const d
= upower
? upower.displayDevice
: null ;
82 - return (d
&& d.ready
&& d.isLaptopBattery
&& d.healthSupported)
? Number (d.healthPercentage)
: null ;
85 + return (d
&& d.ready
&& d.isLaptopBattery
&& d.healthSupported)
? Number (d.healthPercentage)
* 100 : null ;
84 87 readonly property bool isLaptopBattery: {
85 88 const d
= upower
? upower.displayDevice
: null ;
86 89 return !! (d
&& d.ready
&& d.isLaptopBattery);
92 + readonly property var batteryPercent: {
93 + const d
= upower
? upower.displayDevice
: null ;
94 + return (d
&& d.ready
&& d.isLaptopBattery)
? Math .
round (
Number (d.percentage)
* 100 )
: null ;
96 + readonly property string batteryStatus: {
97 + const d
= upower
? upower.displayDevice
: null ;
98 + if (
! d
|| ! d.ready
|| ! d.isLaptopBattery)
102 + case UPowerDeviceState .Charging:
103 + case UPowerDeviceState .PendingCharge:
105 + case UPowerDeviceState .FullyCharged:
107 + case UPowerDeviceState .Discharging:
108 + case UPowerDeviceState .PendingDischarge:
109 + return "on battery" ;
88 114 readonly property var degradationReason: {
89 115 if (
! powerProfiles)
391 + "percent" : batteryPercent
, 392 + "status" : batteryStatus
, 365 393 "healthPercentage" : healthPercentage
, 366 394 "isLaptopBattery" : isLaptopBattery