%global debug_package %{nil} Name: apple-powerd Version: 0.17.2 Release: 1%{?dist} Summary: macOS-style power, idle and brightness management License: MIT Source0: %{name}-%{version}.tar.gz BuildRequires: cargo-rpm-macros >= 26 BuildRequires: gcc BuildRequires: pkgconfig(dbus-1) BuildRequires: systemd-rpm-macros Requires: iw Requires: polkit Requires: systemd Requires: upower Obsoletes: darkwake < 0.16.0 %description One user service for the power behaviour of an M-series MacBook Pro: auto-brightness that learns from adjustments, a dim stage before display off, slight dimming on battery, a low-light keyboard backlight that is never lit with the displays off, separate battery and adapter timings, lock before every sleep, lid sleep unless docked, audio keeping the machine awake, a low battery notification and sleep, and a per-sleep battery drain log. Uses only logind, UPower, ext-idle-notify and wlr-output-power-management (niri IPC as a fallback), so it runs on any Wayland laptop. Optional connected sleep with scheduled dark wakes (darkwake.service) needs the kernel s2idle wake timer. %prep %autosetup -n %{name}-%{version} %cargo_prep -N # build online: the crates are not packaged for Fedora sed -i 's/^offline = true$//' .cargo/config.toml %build %{__cargo} build %{__cargo_common_opts} --profile rpm -p apple-powerd %install install -Dpsm0755 target/rpm/apple-powerd %{buildroot}%{_bindir}/apple-powerd install -Dm644 crates/apple-powerd/apple-powerd.service %{buildroot}%{_userunitdir}/apple-powerd.service install -Dm644 crates/apple-powerd/90-apple-powerd.preset %{buildroot}%{_userpresetdir}/90-apple-powerd.preset install -Dm644 crates/apple-powerd/darkwake.service %{buildroot}%{_unitdir}/darkwake.service install -Dm644 crates/apple-powerd/darkwake-sync.target %{buildroot}%{_unitdir}/darkwake-sync.target install -Dm644 crates/apple-powerd/50-darkwake.rules %{buildroot}%{_datadir}/polkit-1/rules.d/50-darkwake.rules install -Dm644 crates/apple-powerd/darkwake.toml %{buildroot}%{_sysconfdir}/apple-powerd/darkwake.toml %check %{__cargo} test %{__cargo_common_opts} --profile rpm --no-fail-fast -p apple-powerd %post %systemd_user_post apple-powerd.service if [ $1 -eq 1 ]; then for uid in $(systemctl list-units 'user@*' --legend=no | sed -n -r 's/.*user@([0-9]+)\.service.*/\1/p'); do systemctl --user -M $uid@ -q is-enabled apple-powerd.service && systemctl --user -M $uid@ -q is-active graphical-session.target && systemctl --user -M $uid@ --no-block start apple-powerd.service || : done fi %preun %systemd_user_preun apple-powerd.service %postun %systemd_user_postun_with_restart apple-powerd.service %files %license LICENSE %doc crates/apple-powerd/README.md crates/apple-powerd/config.toml %{_bindir}/apple-powerd %{_userunitdir}/apple-powerd.service %{_userpresetdir}/90-apple-powerd.preset %{_unitdir}/darkwake.service %{_unitdir}/darkwake-sync.target %{_datadir}/polkit-1/rules.d/50-darkwake.rules %dir %{_sysconfdir}/apple-powerd %config(noreplace) %{_sysconfdir}/apple-powerd/darkwake.toml %changelog * Sun Nov 22 2026 Lachlan Marie - 0.17.2-1 - Resend DDC brightness on display wake and every 30 s * Thu Nov 19 2026 Lachlan Marie - 0.17.1-1 - Run plug hooks after unplug during sleep * Wed Nov 18 2026 Lachlan Marie - 0.17.0-1 - Deep dim held 15 s before display off - Smooth fixed-time stage fades - Quick return from deep dim * Wed Nov 18 2026 Lachlan Marie - 0.16.2-1 - Start services on first install - Enable by preset * Wed Nov 18 2026 Lachlan Marie - 0.16.1-1 - niri display power via `niri msg` - Drop futures-util dep * Wed Nov 18 2026 Lachlan Marie - 0.16.0-1 - Absorb darkwake: `apple-powerd darkwake` - `[sleep] dark_wakes`: idle and lid sleep via darkwake.service - darkwake config now /etc/apple-powerd/darkwake.toml - Low battery in a dark wake: sleep on, no more wakes * Wed Nov 18 2026 Lachlan Marie - 0.15.3-1 - Battery brightness 10-25 % (cap 25 %, perceptual) - Log sleep drain in watts * Wed Nov 11 2026 Lachlan Marie - 0.15.2-1 - Skip the tick between sleep and wake - Fast ramp back from an interrupted fade - Restore the backlight only once the panel is dark - Debounce charger blips 5 s - Brightness past the battery cap lifts it - Sense light while displays are off, not under a closed lid - Last real trip decides a low-trip full charge * Tue Nov 10 2026 Lachlan Marie - 0.15.1-1 - Lock screen off after 20 s of no input - Ignore idle inhibitors while locked * Mon Nov 09 2026 Lachlan Marie - 0.15.0-1 - Split from apple-extras