Enables proper handling of Ideapad laptops by skipping `set_platform_profile` when it is decoupled from fan control, improving compatibility and user feedback.
New Features
- Added `is_ideapad()` helper function.
Enhancements
- Conditional execution of `set_platform_profile` based on Ideapad detection.
- Added informative messages when platform profile is skipped on Ideapad.
Bug Fixes
- None.
New Features
- Added explicit error handling and logging for `fuser` command failures.
Enhancements
- Refined process termination logic with richer diagnostics and graceful degradation when tools are unavailable.
Bug Fixes
- Prevented silent failures when stopping `nvidia-persistenced.service` by logging errors instead of ignoring them.
- None
Enhancements- Added detailed error reporting with exit codes for privilege escalation, initramfs rebuild, service management, and session termination
- Implemented graceful handling of permission‑setting failures with proper logging
- Enhanced error messages for systemctl and loginctl commands, providing clearer diagnostics
Bug Fixes- Fixed incomplete error propagation in status matching, now reports actual exit codes or underlying errors
- **New Features**: Added detailed error logging for signal handling, directory creation, cache file operations, and service management; improved cleanup with explicit error propagation.
- **Enhancements**: Refactored Drop implementations to handle failures gracefully; upgraded status handling for systemctl commands with precise exit code reporting; strengthened directory and file removal with debug logging.
- **Bug Fixes**: Fixed missing error propagation in Ctrl+C handler; corrected service enable/disable status reporting; ensured proper removal of cache files and directories with appropriate logging of failures.
- New Features: Add `--no-reboot` flag usage example for GPU switching
- Enhancements: Document Wayland auto‑detection and new safety mechanisms (concurrency lock, interrupt‑safe restart, atomic writes)
- Bug Fixes: Minor phrasing corrections and typo fixes in README sections
The change ensures that only valid battery percentages (1‑100) are processed, preventing out‑of‑range values from reaching the underlying command.
- New Features
- Validation of battery limit percentage added.
- Enhancements - Better error reporting for invalid arguments.
- Bug Fixes
- Prevents processing of invalid battery limit values.
- Improves robustness of NVIDIA GPU PCI bus detection.
- Adds validation for unexpected PCI format strings.
- Prevents panic by handling missing command output and malformed IDs gracefully.
Add several new crates (block2, cfg_aliases, ctrlc, dispatch2, fs2, nix, objc2, objc2-encode, winapi and their sub‑crates) to support new functionality and improve compatibility. Bump versions of core crates (libc, futures-core, etc.) to latest releases.
- New Features:
- Introduce `block2`, `cfg_aliases`, `ctrlc`, `dispatch2`, `fs2`, `nix`, `objc2`, `objc2-encode`, and `winapi` (including target‑specific crates) to enable additional system interaction and async capabilities.
- Enhancements:
- Upgrade `libc`, `futures-core`, `futures-util`, `tokio`, `clap`, `serde`, and other dependencies to latest stable versions for performance and security improvements.
- Bug Fixes:
- Updated checksums and dependency resolution to reflect newer releases, reducing potential runtime issues.
Log a warning when the initramfs rebuild is skipped because the distribution is unknown, ensuring the user is informed.
New Features
- None
Enhancements
- Added explicit warning for unknown distributions to prevent silent skips
- Improved logging clarity in rebuild_initramfs
Bug Fixes
- Fixed missing warning path that could hide build issues on unsupported distros
The changes add robust interruption support, exclusive‑lock enforcement, and safer file handling to the GPU switching commands, while clarifying installation output.
- New Features - Atomic `INTERRUPTED` flag with Ctrl‑C signal handler
- `DmGuard` struct to manage display‑manager start/stop lifecycle
- `LockGuard` with exclusive lock file (`/var/lock/lapctl.lock`) to serialize GPU switches
- Safe temporary‑file write + rename for cache updates
- Enhancements
- Unified `prepare_no_reboot` returns `DmGuard` instead of `Option<String>`
- Consistent early‑exit handling with lock acquisition checks
- Improved debug/info logging for DM actions
- Restructured `finalize_no_reboot` to return a guard value
- Clarified installation success/failure messages for `lapctld`
- Bug Fixes
- Prevented race conditions on concurrent GPU switches by locking before operation
- Ensured lock is released on early return paths
- Fixed incomplete `finalize_no_reboot` handling
- Corrected daemon enable detection and user feedback logic
New Features:
- Enables cloning of GpuCommands variants for greater flexibility.
Enhancements:
- Improves CLI ergonomics by allowing command enum to be transmitted across async boundaries.
Enable automatic handling of NVIDIA commands in Wayland sessions and generate proper Xorg config snippets.
- New Features
- Adds `is_wayland_session()` that detects a Wayland environment via `WAYLAND_DISPLAY` or `XDG_SESSION_TYPE`.
- Adds `xorg_modesetting(bus_id)` that builds a full Xorg configuration snippet for the modesetting driver.
- Enhancements
- `switch_nvidia()` now automatically treats NVIDIA commands as Wayland‑aware when a Wayland session is detected.
- Refactored command matching in `execute()` to preserve original fields while injecting Wayland awareness.
- Fixed daemon invocation to pass a reference to the (potentially transformed) command.
- Bug Fixes
- Corrected argument passing in `try_call_daemon` and `execute_local` to avoid move errors.
- Prevented duplicate command handling when a Wayland session is detected.
Simplify daemon interface by removing obsolete system inhibition logic.
New Features
-
Enhancements
- Cleaned up dead code path.
-
Bug Fixes
- Prevented potential file descriptor leak by removing inhibition handling.
- New Features:
- Enhancements: Simplified command construction in rebuild_initramfs.
- Bug Fixes: Resolved potential error when systemd-inhibit is unavailable.
New Features
-
Enhancements
- Dropped inhibit subcommand and related modules.
- Cleaned up command handling logic in main.rs.
Bug Fixes- No bug fixes introduced.
Updated Cargo.lock and Cargo.toml to version 0.3.2 of the `lapctl` package.
New Features
- None
Enhancements
- Updated dependency version to 0.3.2Bug Fixes
- None
Why: Adopt local execution path to streamline command handling and reduce RPC overhead.
New Features
-
Enhancements
- Replace `gpu::execute` with `gpu::execute_local` in integrated, hybrid, and nvidia command invocations.
- Replace `crate::commands::power`, `battery`, `cooling`, and `touchpad` executions with `execute_local`.
- Remove the unused `LAPCTL_DAEMON_INTERNAL` environment variable setting.
Bug Fixes
- None
Refactored command flow to separate daemon invocation, added status handling, and improved error handling.
- New Features: Added `execute_local` helper and `BatteryCommands::Status` handling.
- Enhancements: Simplified daemon checks, removed redundant condition, improved readability and error messages.
- Bug Fixes: Fixed missed daemon return path for status command and ensured proper touchpad inhibition logic.
Set an internal environment variable when the daemon starts to allow components to detect internal mode and prepare for future runtime configuration.
- New Features
- Introduce `LAPCTL_DAEMON_INTERNAL` set to "1" inside the daemon.
- Enhancements
- Enable downstream components to detect internal daemon execution.
Adds 2‑second timeouts around D‑Bus interactions and guards against internal daemon self‑calls; refactors command handling to use a consistent async timeout pattern and improves error reporting.
New Features
- Wrap D‑Bus calls with a 2‑second timeout to prevent hangs
- Early‑exit when $LAPCTL_DAEMON_INTERNAL is set to skip self‑calls- Apply consistent timeout usage across all commands
Enhancements
- Unified error handling using the `matches!` macro
- Reduced race conditions in connection establishment
Bug Fixes
- Prevent silent failures when a connection timeout occurs
The command enables launching Steam directly on the dGPU while in hybrid mode, improving performance for gaming workloads.
New Features
- Introduces `lapctl gpu run steam` to run Steam on dGPU directly in hybrid mode.
Enhancements
- Updated README with documentation for the new GPU command.
Bug Fixes
- None.
Running applications on the dGPU now requires proper environment variable setup and runtime mode checking. The implementation includes warnings when the system is not in hybrid mode and logs the launched command and its exit status.
- New Feature: Implemented `run_on_dgpu` function to execute commands with NVIDIA offload environment variables.
- Enhancement: Added runtime mode verification and warning for non‑hybrid configurations.
- Enhancement: Added informational logging for launched command and process exit status.
- New Features
- Introduce `Run` command with trailing var argument support for executing commands on the discrete GPU (requires Hybrid Mode)
- Enhancements
- Update CLI parsing to accept a vector of command strings
- Bug Fixes
- None
Add native Wayland refresh rate control using zwlr_output_manager_v1, remove reliance on xrandr, and document limitations for GNOME/KDE. This enables on‑the‑fly Hz changes without external tools.
- New Feature: Native Wayland refresh rate management
- Enhancement: Updated requirements and limitations sections
- Enhancement: Improved documentation for refresh rate control
Add function to retrieve and display active monitor information, and expose it via status command.
New Features:
- Implement get_active_display_info returning formatted display strings.
- Extend status command to list active displays using the new function.
Enhancements:
- Improve console output for display information.
- Update dependency usage for cleaner code.
Bug Fixes:
- None
New Features
- Create `src/commands/display.rs` providing `execute` handling for `Rates` and `SetRate` commands, querying refresh rates and applying configuration via Wayland output manager
- Implement mode enumeration, deduplication, and marker labeling (current/preferred) for displayed modes
- Enable fuzzy matching of target refresh‑rate when setting a new rateEnhancements
- Register the `display` module in `src/commands/mod.rs`
- Extend `AppState` with manager, heads, and modes maps plus configuration state tracking
- Add dedicated error handling for unsupported compositorsBug Fixes
- None
Implement display command to query and set refresh rates.
New Features
- Add DisplayCommands with Rates and SetRate subcommands
- Register display command in CLI dispatcher
Enhancements
- Extend command dispatch to handle Display subcommand
Bug Fixes
- None
- **New Features**
- Introduce `lapctl display rates` to list available refresh rates.
- Add `lapctl display set-rate <HZ>` to change the active display’s refresh rate.
- Support runtime detection on Hyprland, Sway, KDE Plasma, GNOME, and X11 back‑ends.
- **Enhancements**
- Include `wayland-client` and `wayland-protocols-wlr` crates with the `client` feature.
- Update `Cargo.toml` to declare the new Wayland-related dependencies.
- Expand README with usage examples for refresh‑rate management.
- **Bug Fixes**
- No bug fixes introduced in this change.
Implemented touchpad control to allow enabling and disabling the touchpad via lapctl.
- New Features
- Add `touchpad` command with `enable` and `disable` subcommands.
- Enhancements
- Extend CLI parsing and command routing to support touchpad operations.
- Bug Fixes
- (none)
Add integration tests that verify the inhibit command parses arguments correctly, covering normal execution, daemon flag usage, and default values for why and who. This provides regression protection for CLI parsing behavior.
- New Feature: Integration tests for inhibit subcommand parsing
The refactor extracts argument construction into a reusable build_args function and adds unit tests, improving modularity and test coverage.
New Features
- Introduce build_args helper to construct inhibit command arguments.
- Add comprehensive unit tests for both empty and non‑empty argument scenarios.
Enhancements
- Refactor existing argument handling to use build_args, eliminating duplicated logic.
- Improve readability and maintainability of the inhibit command implementation.
Bug Fixes
- None
New Features
- Added installation guide using `just` (recommended) and `cargo`.
Enhancements
- Documented systemd and X11/NVIDIA tool requirements.
Bug Fixes
- None.
Switch to more descriptive headings and embed badges for quick visual cues. Provide explicit command usage examples and clarify under‑the‑hood layout.
New Features
- Added clear command examples for graphics, battery, power, cooling, and inhibit operations.
- Highlighted benefits such as charge‑limit tuning and TDP limits.
Enhancements
- Reorganized content with badges, dividers, and a project layout diagram.
- Improved readability and navigation of key features.
Bug Fixes
- None.
Introduce inhibit subcommand to prevent system sleep while tasks run, offering flexible daemon and why options.
- New Features
- Added inhibit.rs module with `lapctl inhibit`, `lapctl inhibit --daemon`, and `lapctl inhibit --why "..."`.
- Updated README.md with detailed Sleep Inhibitor description and usage examples.
- Enhancements
- Added Sleep inhibitor entry to the project checklist under Tool configuration saving.
- Included inhibit.rs in the project structure listing.
- Improved CLI help context for power and cooling sections.
- Bug Fixes
- No bug fixes included in this change.
The new inhibit subcommand lets users block suspend/sleep while optionally running a command, specifying why and who, and running in daemon mode.
- New Features
- Introduce Inhibit subcommand with command, why, who, and daemon options
- Enhancements
- Extend CLI parsing to support additional arguments
- Enable background inhibition via daemon flag for continuous prevention
This command prevents system sleep while optionally executing a user‑provided command, offering both foreground and background inhibition modes.
- New Features
- Implemented inhibit.rs with logic to invoke systemd-inhibit.
- Exposed inhibit functionality by adding pub mod inhibit; to src/commands/mod.rs.
- Enhancements
- (none)
- Bug Fixes
- (none)
Add a Justfile defining tasks for formatting, linting, testing, building, cleaning, and installing lapctl.
- New Features: introduce default target to list recipes and provide cargo-like commands
- Enhancements: streamline common development workflows
- Bug Fixes: none
Implemented clearer cooling profile output by mapping mode codes to
human‑readable names and prefixing with "(ASUS)". Refactored thermal
detection loops for better readability and moved debug logging into the
correct block for GPU cache creation.
New Features
- Map mode strings "0","1","2" to readable cooling profile names
(Performance, Balanced, Quiet / Battery Saving) and print them with
"(ASUS)" label.
- Provide explicit cooling profile description in command output.
Enhancements
- Simplify Intel RAPL and AMD hwmon detection loops for clearer flow.
- Adjust brace placement in GPU cache creation to ensure debug log is
emitted only on successful cache write.
- Minor formatting and style clean‑ups across battery, GPU, and power
commands.
Bug Fixes
- Fix missing/incorrect closing braces in battery and power command
parsers that previously caused compilation warnings.
- Ensure thermal detection logic only accesses sysfs entries after
successful directory read.
- New Features
- None
- Enhancements
- Simplified percent range validation for battery mode.
- Combined existence and read checks for sysfs entries, removing redundant branches.
- Streamlined systemctl command arguments and removed unnecessary references.
- Removed superfluous braces and simplified cooling profile detection logic.
- Improved robustness of sysfs parsing for Intel RAPL and AMD hwmon temperature limits.
- Bug Fixes
- Fixed battery percent validation to use inclusive range (1..=100) instead of incorrect reference comparison.
Refactor internal CLI module layout to streamline imports and separate concerns.
- Enhancements
- Consolidated CLI modules into `lapctl::cli` and `lapctl::commands`.
- Updated imports in `main.rs` to use absolute paths.
- Removed redundant module declarations from `main.rs`.
- Added badges for license, language, and OS
- Expanded description highlighting graphics control, battery health, power saving, and cooling control
- Introduced new sections: What It Can Do, how to use it, and project layout
- Added Installation Rules file and organized CLI examples
- Updated contribution and licensing language
- Organized project structure with new lib.rs, commands, and test modules
- New Features
- Cooling Control for fan profiles on Lenovo/ASUS laptops
- Enhancements
- Detailed README with badges and clearer feature explanations
- New sections explaining usage and project layout
- Added install_rules.rs and reorganized CLI docs
- Bug Fixes
- None
- Made the three helper functions public to allow external usage
- Facilitates reuse of GPU configuration helpers
- No functional changes beyond visibility
Add tests for CLI argument parsing and GPU command generation to increase coverage and ensure future changes don't break functionality.
New Features
- Add unit test `verify_cli` to ensure Clap command is built correctly.
- Add unit tests for `xorg_intel`, `xorg_amd`, and `generate_xrandr_script` functions.
- Validate that generated Xrandr scripts contain expected provider settings.
Enhancements
- none
Bug Fixes
- none
Add CI pipeline for Rust project to enforce formatting, clippy, and tests:
New Features
- Introduce Rust CI workflow triggered on push and pull_request to main/master
- Execute cargo fmt check, cargo clippy with deny warnings, cargo build, and cargo test
Enhancements
- No enhancements
Bug Fixes
- No bug fixes
Add `info!` logging when a NVIDIA GPU is discovered via `lspci`, enhancing debug visibility. Refactor the `lspci` and `xrandr` command constructions into multi‑line style for consistency and prepare a regex for future AMD GPU name detection.
- New Features: Log GPU detection with `info!` macro.
- Enhancements: Refactor command calls for readability; introduce regex preparation for AMD detection.
- Bug Fixes: None.
New Features
- Introduced `InstallRules` subcommand to install udev rules for rootless operation.
Enhancements
- Streamlined `LimitTdp` and `Limit` enum variants by removing unnecessary wrapper structs.
- Updated command dispatch in `main` to handle the new `InstallRules` variant.
Why: Ensure correct detection of EndeavourOS and provide clearer command building for initramfs.
- New Features: Added explicit multi‑condition detection with proper braces for EndeavourOS handling.
- Enhancements: Improved readability of systemd‑inhibit command construction.
- Bug Fixes: Resolved syntax issue that could cause command generation failure.
Restructure loops, add explicit error handling, improve multi‑line messages, and fix formatting issues.
- Enhancements
- Use explicit braces for error branches to prevent silent failures
- Wrap warning and informational messages in multi‑line `println!` with consistent spacing
- Refactor directory reads for Ideapad fallback to avoid nested `let` bindings
- Improve parsing and formatting of AMD TDP limit output with clear parentheses
- Provide clearer debug logging when writing to threshold files
- Bug Fixes
- Added missing braces around error handling to ensure proper execution flow
- Fixed variable binding scope for `ideapad_entries` to prevent shadowing
- Ensured consistent handling of missing `charge_control_end_threshold` across all entries
no changes.
Add acknowledgment of EnvyControl and change license from AGPL-3.0 to MIT.
New Features
-
Enhancements
- Added credits to EnvyControl.
- Updated license to MIT.
Bug Fixes
-
New Features
- Add per‑CPU power limit commands using Intel RAPL (PL1/PL2) and AMD hwmon constraints
- Expose current TDP limits in status output, distinguishing RAPL, AMD hwmon, or hardware‑managed
- Gracefully handle absence of required sysfs entries
Enhancements
- Extend the power command set with a `LimitTdp` sub‑command
- Add debug logging for limit application attempts
Bug Fixes
- Ensure the command degrades gracefully when hardware does not support dynamic power caps
- New Features
- Implement fan_mode control for Ideapad laptops
- Implement thermal policy control for ASUS laptops via WMI
- Provide cooling command supporting performance, balanced, and quiet profiles
- Enhancements
- Display current cooling profile in `lapctl status` output
- Bug Fixes
- None
Adds a new Cooling command group with selectable fan profiles (Performance, Balanced, Quiet) and updates the CLI and logging accordingly.
- New Features
- Introduce Cooling subcommands for setting thermal management modes
- Implement runtime logic to apply selected fan profiles
- Enhancements
- Extend CLI enum `Commands` to include `Cooling` and dispatch handling
- Refine env_logger formatting to output only `[LEVEL] message`
- Integrate cooling execution into the main command dispatch flow
- Bug Fixes
- No bug fixes introduced in this change
The changes introduce a robust `BatteryCommands::Limit` implementation that validates user‑provided percentages, writes charge‑control thresholds, and gracefully handles Lenovo Ideapad firmware via the `conservation_mode` fallback. The `lapctl status` command is also updated to display battery‑specific details such as capacity, status, and charge limits, replacing the previous generic placeholder.
New Features
- Added `BatteryCommands::Limit` handling with range validation (1‑100) and support for multiple `/sys/class/power_supply` entries.
- Implemented Ideapad fallback using `conservation_mode` to provide custom charge limits or warnings when unsupported.
- Extended `lapctl status` to show charge limit and Conservation Mode for each battery.
Enhancements
- Added root‑privilege check (`assert_root`) and improved error/debug logging throughout the command.
- Restructured directory traversal logic for readability and added `debug!` traces on write failures.
- Re‑used status logic to present battery‑specific information instead of a generic placeholder.
Bug Fixes
- Resolved placeholder status output and proper handling of missing `charge_control_end_threshold` files.
- Ensured correct exit codes and clear error messages for invalid percentage inputs.
The `status` command now displays the current power profile by reading `/sys/firmware/acpi/platform_profile`, giving users insight into power usage.
New Features
- Output power profile status to the console.
Enhancements
- Enriches status command with additional hardware information.
The removed file contained outdated GPU power‑management integration now handled elsewhere; updating the README marks the associated tasks as completed.
Enhancements:
- Marked CLI structure, GPU mode switching, and hardware status command as completed.
Set CPU scaling governor, energy performance preference, and ACPI platform profile for performance, balanced, and battery‑save modes. Added root assertion and detailed logging.
- New Features: Added set_cpu_governor, set_energy_performance_preference, set_platform_profile; integrated into execute for each PowerCommands variant.
- Enhancements: Use of logging to report successes/failures; fallback to modern scheduler governor (schedutil); validation of CPU sysfs paths.
- Bug Fixes: Guard against missing sysfs entries; improved debugging messages.
Add clap‑based CLI with subcommands (gpu, battery, power, status), verbose flag, and detailed options such as rtd3, use_nvidia_current, etc.
- New Features
- New CLI entry point with complete subcommand hierarchy
- Verbose logging support
- Granular command options for GPU, Battery, Power, Status
- Enhancements
- Replace placeholder hello world with proper logging initialization
- Modularize command implementations into dedicated modules
New Features:
- Battery module with placeholder `info` function.
- GPU module with functions to detect NVIDIA mode, retrieve PCI bus IDs, identify Intel/AMD iGPU vendors, and extract AMD GPU names via xrandr.
Enhancements:
- Add logging for diagnostic messages and runtime checks.
- Include safety validation for external commands (lspci, xrandr) and configuration files.
Added full command implementations for battery limit/status, GPU management (cache operations, mode switching, NVIDIA handling), and a status reporter that prints GPU mode and battery details. Introduced module registration and placeholder power command.
New Features
- Battery command support (`limit`, `status`)
- GPU command suite (`cache-delete`, `cache-query`, `reset`, `reset-sddm`, `integrated`, `hybrid`, `nvidia`)
- Status command output showing GPU mode and battery information
- Power command placeholder scaffold
Enhancements
- Unified command registration via `mod.rs`
- Added root checks and file utilities for cache and config operations
- Integrated logging infrastructure
Bug Fixes: none
- New Features
- Introduced cached configuration for hybrid Optimus systems
- Added command‑line options for switching, resetting, and cache management
- Enhancements
- Integrated clap‑derived CLI parsing
- Updated project dependencies via Cargo.lock
- Improved error handling and logging
Add empty system.rs file in src/utils as a placeholder for future system utilities.
- New Features
- Add system module skeleton
- Enhancements
- Bug Fixes
- New Features
- battery.rs: new command to display battery charge and health
- gpu.rs: new command to query GPU utilization and temperature
- power.rs: new command to show power consumption and mode
- status.rs: new command to provide overall system status overview
Add main entry point and scaffold CLI module to start building the tool.
- New Features:
- Added `src/main.rs` with a hello‑world entry point.
- Added `src/cli.rs` as placeholder for future CLI command definitions.
- Enhancements:
- None
- Bug Fixes:
- None
Why: initialize Rust project and configure ignore patterns
New Features
- Initialize new Rust package `lapctl`.
Enhancements
- Add .gitignore entries for IDE metadata and build output.
Bug Fixes
- (none)
This adds the project's README documenting its purpose, planned features, and roadmap to orient contributors and users.
- New Features
- Introduce overview of lapctl, including hybrid GPU control, battery limit management, and status commands
- Enhancements
- Provide structured sections for project status, goals, example CLI, and roadmap
- Bug Fixes
- None