Skip to content

CLI-only Python backend that enforces power profiles on GNOME for Framework Laptop 13. Reads simple JSON to set min/max refresh per display, optionally cap or pick exact modes, and toggle GNOME animations/extensions. Uses Mutter DisplayConfig and gnome-extensions CLI; designed as the logic core that a GUI can wrap later.

License

GPL-3.0, GPL-3.0 licenses found

Licenses found

GPL-3.0
LICENSE
GPL-3.0
LICENSE.md
Notifications You must be signed in to change notification settings

dracid/framework_battery_autosaver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Power Saver for Framework Laptop 13 (Ubuntu 24.04+)

A small, open-source Python tool that applies consistent power-saving settings to the GNOME desktop environment on Ubuntu Linux 24.04, designed specifically for the Framework Laptop 13.

The project is split into two independent parts:

  1. Back-End (CLI / Service)

    • Applies and reports GNOME/system power settings
    • Contains all power-management logic
    • Runs as a standalone script or as a login-time service
    • No GUI dependencies
  2. Front-End (GUI)

    • Simple Tkinter or GTK interface
    • Only calls the back-end
    • Never modifies system settings directly

This separation keeps the core logic testable, predictable, and easy to automate.


Features (Planned and In Progress)

Back-End

  • Read current GNOME power-related settings
  • Apply a predefined “Power Saving” profile
  • Clear logging of all changes
  • Idempotent operation (safe to run repeatedly)
  • Optional autostart at session login

Front-End GUI

  • Lightweight interface (Tkinter or GTK)
  • Shows active profile or status
  • Lets users apply profiles with one click
  • Pure wrapper around the back-end

Why This Exists

Ubuntu GNOME provides many power-related settings, but they are spread across:

  • gsettings
  • power-profiles-daemon
  • GNOME session settings
  • Display and suspend timeouts

This project consolidates a reasonable, laptop-focused power-saving configuration into one tool that can be run on demand or automatically at login.


Project Structure (Draft)

.
├── backend/
│   ├── cli.py         # Command-line interface
│   ├── core.py        # Logic for reading/applying settings
│   └── profiles.py    # Definitions of power-saving profiles
├── frontend/
│   └── gui.py         # Tkinter or GTK front-end
├── tests/
├── LICENSE
└── README.md

Target System

  • Hardware: Framework Laptop 13
  • OS: Ubuntu Linux (LTS recommended)
  • Desktop: GNOME (Wayland or Xorg)
  • User permissions: Regular user; only use sudo when absolutely required

The tool should also work on other GNOME-based systems, but Framework 13 on Ubuntu is the reference configuration.


Development Guidelines

This project follows several principles:

  • Clean, concise Python (PEP8)
  • Small, understandable modules
  • No unnecessary dependencies
  • Back-end remains GUI-independent
  • GUI remains logic-free
  • All changes are explained and double-checked before implementation

License

Released under the GNU GPLv3.
See LICENSE for details.


Status

The project is in early design and implementation stages.
Back-end CLI design is the first focus before GUI development.


Quick Examples (Display Refresh)

  • List available refresh modes for the built-in/primary display:
    python3 backend/apply_refresh_profile.py --list
  • List for a specific connector (e.g., laptop panel):
    python3 backend/apply_refresh_profile.py --list --connector eDP-1
  • Apply minimum refresh profile:
    python3 backend/apply_refresh_profile.py min
  • Apply maximum refresh profile on a specific connector:
    python3 backend/apply_refresh_profile.py max --connector eDP-1
  • Apply max with a ceiling (e.g., cap at 96 Hz):
    python3 backend/apply_refresh_profile.py max --connector eDP-1 --max-cap 96
  • By default min/max apply to all connected displays; use --connector to limit to one.
  • Apply an exact mode id:
    python3 backend/apply_refresh_profile.py --mode-id [email protected] --connector eDP-1
  • Reapply current modes without changing selections (useful to nudge Mutter):
    python3 backend/apply_refresh_profile.py --reapply-current
  • Profiles also set GNOME animations: min disables them; max enables them.
  • Profiles can enable/disable extensions (e.g., min disables, max enables [email protected] by default).

Contributing

Contributions and suggestions are welcome once the initial architecture is in place.
Please open issues for discussions or proposed improvements.

About

CLI-only Python backend that enforces power profiles on GNOME for Framework Laptop 13. Reads simple JSON to set min/max refresh per display, optionally cap or pick exact modes, and toggle GNOME animations/extensions. Uses Mutter DisplayConfig and gnome-extensions CLI; designed as the logic core that a GUI can wrap later.

Resources

License

GPL-3.0, GPL-3.0 licenses found

Licenses found

GPL-3.0
LICENSE
GPL-3.0
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages