feat(src): update

This commit is contained in:
sankalp committed 2026-03-12 00:14:54 +05:45
1 parent 569775f549
commit 387047748a
4 files changed
+49 -42

No files matched your search

+45 -38
View File
@@ -1,53 +1,58 @@
# lapctl # lapctl
**lapctl** is an upcoming command-line utility written in Rust for managing laptop hardware features on Linux. **lapctl** is a powerful, dependency-free command-line utility written in Rust. It is designed to provide seamless hardware management for Linux laptops.
It aims to provide a simple and unified interface for controlling hybrid GPU modes, battery charging limits, and other laptop power features directly from the terminal. By interfacing directly with the Linux kernel and ACPI endpoints, `lapctl` provides a unified interface for controlling hybrid GPU modes, battery charging thresholds, and thermal/power profiles—all from the terminal.
--- ---
## Planned Features ## Key Features
- Switch GPU modes on hybrid graphics laptops - **Hybrid GPU Management:** Switch effortlessly between Integrated, Nvidia, and Hybrid graphics modes (Optimus).
- Integrated GPU - **Battery Health:** Enforce battery charging thresholds (e.g., 80%) to maximize chemical lifespan.
- Hybrid mode - **Power Profiling:** Dynamically adjust ACPI Platform Profiles, CPU scaling governors, and TDP (Wattage) limits.
- NVIDIA GPU - **Thermal Controls:** Direct hardware hooks for proprietary cooling solutions (e.g., Lenovo Ideapad, ASUS).
- **Hardware Polling:** Comprehensive hardware status checking without heavy daemon dependencies.
- Set and manage battery charging limits
- View laptop hardware and power status
- Lightweight and fast CLI interface
- Designed for Linux systems with hybrid GPUs (Optimus)
--- ---
## Project Status ## Example CLI
**Stable**
This project has reached its first stable milestone with all planned features implemented.
---
## Goals
- Provide a **simple CLI interface** for laptop hardware management
- Support **hybrid GPU laptops (Intel + NVIDIA / AMD + NVIDIA)**
- Offer **battery health features like charge limit control**
- Be **lightweight, fast, and easy to use**
---
## Example CLI (Planned)
```bash ```bash
# GPU Modes
lapctl gpu integrated lapctl gpu integrated
lapctl gpu hybrid lapctl gpu hybrid
lapctl gpu nvidia lapctl gpu nvidia
# Battery Controls
lapctl battery limit 80 lapctl battery limit 80
lapctl battery status lapctl battery status
# Power Profiles
lapctl power performance
lapctl power balanced
lapctl power battery-save
# Raw Wattage Capping
lapctl power limit-tdp 35
# Cooling/Thermal Overrides (Lenovo/ASUS)
lapctl cooling performance
lapctl cooling balanced
lapctl cooling quiet
# Check All Hardware
lapctl status lapctl status
# --- lapctl status ---
# GPU Mode: hybrid
# BAT1:
# Capacity: 99%
# Status: Full
# Charge Limit: 100%
# Power Profile: balanced
# Cooling Profile: Balanced (Ideapad)
# CPU TDP Limit: Hardware Managed
``` ```
--- ---
@@ -78,25 +83,27 @@ lapctl
│ │ ├── gpu.rs │ │ ├── gpu.rs
│ │ ├── battery.rs │ │ ├── battery.rs
│ │ ├── power.rs │ │ ├── power.rs
│ │ ├── cooling.rs
│ │ └── status.rs │ │ └── status.rs
│ │ │ │
│ ├── hardware/ │ ├── hardware/
│ │ ├── mod.rs │ │ ├── mod.rs
│ │ ├── gpu.rs │ │ └── gpu.rs
│ │ └── battery.rs
│ │ │ │
│ └── utils/ │ └── utils/
│ └── system.rs │ └── system.rs
``` ```
## Roadmap ## Core Capabilities
- [x] CLI structure - [x] CLI structure and routing architecture
- [x] GPU mode switching - [x] GPU mode switching and configuration orchestration
- [x] Battery charge limit management - [x] Battery charge limit management (sysfs & Ideapad conservation mode)
- [x] Hardware status command - [x] Comprehensive hardware status polling
- [x] Configuration support - [x] Configuration support and state caching
- [x] Thermal/Cooling profiles (Lenovo VPC / ASUS WMI)
- [x] CPU TDP (Wattage) Control (Intel RAPL / AMD hwmon)
--- ---
+4
View File
@@ -94,6 +94,10 @@ pub enum PowerCommands {
Balanced, Balanced,
/// Set power profile to battery saver /// Set power profile to battery saver
BatterySave, BatterySave,
/// Set CPU TDP limit (in Watts)
LimitTdp {
watts: u32,
},
} }
#[derive(Subcommand, Debug)] #[derive(Subcommand, Debug)]
-3
View File
@@ -1,3 +0,0 @@
pub fn info() {
println!("Hardware battery placeholder");
}
-1
View File
@@ -1,2 +1 @@
pub mod battery;
pub mod gpu; pub mod gpu;