Skip to content

Feat/refresh switch#165

Open
Adithya2685-git wants to merge 4 commits intoCachyOS:developfrom
Adithya2685-git:feat/refresh-switch
Open

Feat/refresh switch#165
Adithya2685-git wants to merge 4 commits intoCachyOS:developfrom
Adithya2685-git:feat/refresh-switch

Conversation

@Adithya2685-git
Copy link

@Adithya2685-git Adithya2685-git commented Feb 8, 2026

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.
Screenshot_2026-02-08_21-33-02

…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.
@ptr1337 ptr1337 requested a review from vnepogodin February 8, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant