Add charging indicator and pacman package, bump to 1.1.0

- Show charge/discharge power in watts, a battery graphic with charge
  bolt, a power history graph and the estimated time until full or
  remaining (respecting the 80 % charge limit) in the app, the panel
  widget, its tooltip and `predatorctl status`
- Add packaging/arch/PKGBUILD that builds a pacman package; the kernel
  module ships as DKMS source and is rebuilt for every kernel
- Bump version to 1.1.0

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-07 17:37:03 +02:00
co-authored by Claude Opus 5.5
parent ea7ce49452
commit 2ef62e85cd
17 changed files with 315 additions and 25 deletions
@@ -40,6 +40,21 @@ PlasmoidItem {
return names[key] || key || "–"
}
function temp(v) { return v ? Math.round(v) + " °C" : "off" }
function duration(m) {
if (m === null || m === undefined) return ""
return m >= 60 ? Math.floor(m / 60) + " h " + (m % 60) + " min" : m + " min"
}
function batteryText() {
if (!ok || !st.battery.present) return ""
const b = st.battery
let t = b.capacity + " %"
if (b.charging) t += " · charging" + (b.power_w ? " at " + b.power_w.toFixed(1) + " W" : "")
else if (b.status === "Discharging") t += " · on battery" + (b.power_w ? ", " + b.power_w.toFixed(1) + " W" : "")
else t += b.ac_online ? " · plugged in" : ""
if (b.minutes_left !== null && b.minutes_left !== undefined)
t += " · " + duration(b.minutes_left) + (b.charging ? " until full" : " left")
return t
}
function run(args) {
// unique suffix so the executable engine runs identical commands again
@@ -56,6 +71,7 @@ PlasmoidItem {
toolTipSubText: ok
? profileLabel(st.profile) + " · CPU " + temp(st.sensors.cpu_temp) + " · GPU " + temp(st.sensors.gpu_temp)
+ "\nFans " + (st.sensors.cpu_fan || 0) + " / " + (st.sensors.gpu_fan || 0) + " RPM"
+ "\nBattery " + batteryText()
: "Service predatord not running"
P5Support.DataSource {
@@ -318,13 +334,15 @@ PlasmoidItem {
Layout.fillWidth: true
Layout.topMargin: Kirigami.Units.smallSpacing
Kirigami.Icon {
source: root.ok && root.st.battery.ac_online ? "battery-charging" : "battery"
source: root.ok && root.st.battery.charging ? "battery-charging" : (root.ok && root.st.battery.ac_online ? "battery-full-charging" : "battery")
Layout.preferredWidth: Kirigami.Units.iconSizes.smallMedium
Layout.preferredHeight: Kirigami.Units.iconSizes.smallMedium
}
PC3.Label {
Layout.fillWidth: true
text: root.ok ? root.st.battery.capacity + " % · " + (root.st.battery.ac_online ? "plugged in" : "on battery") : ""
text: root.batteryText()
wrapMode: Text.Wrap
color: root.ok && root.st.battery.charging ? Kirigami.Theme.positiveTextColor : Kirigami.Theme.textColor
}
PC3.CheckBox {
text: "Limit to 80 %"
@@ -12,7 +12,7 @@
"Id": "org.predatorcontrol.panel",
"License": "GPL-2.0-only",
"Name": "Predator Control",
"Version": "1.0.0",
"Version": "1.1.0",
"Website": "https://git.mrblake.cc/MrBlake/Cachy-Predator-Keyboard"
},
"X-Plasma-API-Minimum-Version": "6.0",