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
+3
View File
@@ -0,0 +1,3 @@
*.pkg.tar.*
src/
pkg/
+57
View File
@@ -0,0 +1,57 @@
# Maintainer: Louis-Alexander Kerst <louis@alexander-kerst.de>
#
# Builds the pacman package from this source checkout:
# cd packaging/arch && makepkg -f
# sudo pacman -U predator-control-*.pkg.tar.zst
pkgname=predator-control
pkgver=1.1.0
pkgrel=1
pkgdesc="PredatorSense replacement for Acer Predator laptops: performance modes, fans, keyboard RGB, lightbar, battery (Qt app + Plasma widget)"
arch=('any')
url="https://git.mrblake.cc/MrBlake/Cachy-Predator-Keyboard"
license=('GPL-2.0-only')
depends=('python' 'pyside6' 'dkms')
optdepends=('plasma-workspace: panel widget'
'linux-headers: build the kernel module for the stock Arch kernel'
'linux-cachyos-headers: build the kernel module for CachyOS kernels'
'clang: needed by DKMS for clang-built kernels (CachyOS)'
'lld: needed by DKMS for clang-built kernels (CachyOS)'
'llvm: needed by DKMS for clang-built kernels (CachyOS)')
install=predator-control.install
source=()
_src="$(realpath "$startdir/../..")"
_modver=1.1.0
package() {
cd "$_src"
# Python package and launchers
install -d "$pkgdir/usr/lib/predator-control/predator_control/gui"
install -m644 predator_control/*.py "$pkgdir/usr/lib/predator-control/predator_control/"
install -m644 predator_control/gui/*.py "$pkgdir/usr/lib/predator-control/predator_control/gui/"
python -m compileall -q -d /usr/lib/predator-control "$pkgdir/usr/lib/predator-control"
for b in predatord predatorctl predator-control; do
install -Dm755 "bin/$b" "$pkgdir/usr/bin/$b"
done
# Kernel module as DKMS source (built automatically by the dkms pacman hook)
install -d "$pkgdir/usr/src/predator-wmi-$_modver"
install -m644 kernel/{predator_wmi.c,Makefile,dkms.conf} "$pkgdir/usr/src/predator-wmi-$_modver/"
install -Dm644 data/modules-load-predator-control.conf "$pkgdir/usr/lib/modules-load.d/predator-control.conf"
# Service, resume hook, desktop integration
install -Dm644 data/predatord.service "$pkgdir/usr/lib/systemd/system/predatord.service"
install -Dm755 data/system-sleep-predator-control "$pkgdir/usr/lib/systemd/system-sleep/predator-control"
install -Dm644 data/predator-control.desktop "$pkgdir/usr/share/applications/predator-control.desktop"
install -Dm644 data/predator-control.svg "$pkgdir/usr/share/icons/hicolor/scalable/apps/predator-control.svg"
# Plasma panel widget
local p="$pkgdir/usr/share/plasma/plasmoids/org.predatorcontrol.panel"
install -Dm644 plasmoid/org.predatorcontrol.panel/metadata.json "$p/metadata.json"
install -Dm644 plasmoid/org.predatorcontrol.panel/contents/ui/main.qml "$p/contents/ui/main.qml"
install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
install -Dm644 CHANGELOG.md "$pkgdir/usr/share/doc/$pkgname/CHANGELOG.md"
}
+25
View File
@@ -0,0 +1,25 @@
post_install() {
systemctl daemon-reload
modprobe predator_wmi 2>/dev/null || echo ":: predator_wmi could not be loaded yet (kernel headers installed? Secure Boot?)"
systemctl enable --now predatord.service
echo ":: Predator Control installed."
echo ":: Add the panel widget: right-click the panel -> Add or Manage Widgets -> 'Predator Control'"
echo ":: Only members of the 'wheel' group can change settings."
}
post_upgrade() {
systemctl daemon-reload
modprobe predator_wmi 2>/dev/null
systemctl try-restart predatord.service
}
pre_remove() {
systemctl disable --now predatord.service 2>/dev/null
modprobe -r predator_wmi 2>/dev/null
true
}
post_remove() {
systemctl daemon-reload
echo ":: Settings were kept in /etc/predator-control (delete manually if no longer needed)."
}