Open
Conversation
…e switching Adds a new tweak checkbox that enables/disables the refresh-switch systemd user service. This daemon auto-switches the laptop display refresh rate based on power source (highest Hz on AC, lowest Hz on battery) to save battery life. Supports Hyprland, KDE, and GNOME.
…e switching Standalone Rust daemon that monitors power source via UPower D-Bus and automatically switches the laptop's built-in display (eDP) refresh rate - highest on AC, lowest on battery. Supports Hyprland, KDE, and GNOME backends. Includes systemd user service file.
- Fix set_rate() to find exact rate from mode list instead of formatting an imprecise float (GNOME tools do exact string matching, so 165.002 won't match 165.00195312)
- Use integer Hz formatting ({:.0}) consistent with Hyprland/KDE backends
- Remove -p flag from gnome-monitor-config (not supported on all versions)
- Add environment import to service file for WAYLAND_DISPLAY, DBUS_SESSION_BUS_ADDRESS, etc. so GNOME backend can find the session bus
Set package name to empty so the toggle directly enables/disables the systemd service without trying to install via pacman, since the binary is bundled with the project.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, no distro gives us an option to to auto-switch between refresh rates for laptop users to save battery power.
Everyone has to write their own bash scripts / C codes that typically uses Polling for checking display monitors. This code uses Signal interrupt for efficiency.
This merge request aims to unify all the Desktops to auto switch refresh rates for laptop users conveniently, like how windows does.
Currently, this code supports Hyprland, KDE, and Gnome desktops, and support for other desktops can also be easily added.
The checkbox toggle in CachyOS-Welcome runs systemctl --user enable --now refresh-switch.service which enables persistence as well.
