feat(root): improve README and restructure project documentation

- 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
This commit is contained in:
sankalp committed 2026-03-12 00:36:12 +05:45
1 parent f6d36c6555
commit 435e2d8f3b
1 file changed
+54 -51
+54 -51
View File
@@ -1,70 +1,66 @@
# lapctl
**lapctl** is a powerful, dependency-free command-line utility written in Rust. It is designed to provide seamless hardware management for Linux laptops.
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
![Rust](https://img.shields.io/badge/rust-%23000000.svg?style=flat&logo=rust&logoColor=white)
![Linux](https://img.shields.io/badge/Linux-FCC624?style=flat&logo=linux&logoColor=black)
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.
**lapctl** is a fast and easy command line tool made in Rust. It helps you control your Linux laptop hardware from the terminal.
You can use it to change your graphics card mode, set battery charge limits, pick power profiles, and control the cooling fans. It talks directly to your system hardware, so it does not need any heavy background programs to run.
---
## Key Features
## What It Can Do
- **Hybrid GPU Management:** Switch effortlessly between Integrated, Nvidia, and Hybrid graphics modes (Optimus).
- **Battery Health:** Enforce battery charging thresholds (e.g., 80%) to maximize chemical lifespan.
- **Power Profiling:** Dynamically adjust ACPI Platform Profiles, CPU scaling governors, and TDP (Wattage) limits.
- **Thermal Controls:** Direct hardware hooks for proprietary cooling solutions (e.g., Lenovo Ideapad, ASUS).
- **Hardware Polling:** Comprehensive hardware status checking without heavy daemon dependencies.
**Graphics Control**
Easily switch between Integrated, Nvidia, and Hybrid graphics modes to save battery or get more power.
**Battery Health**
Set a battery charge limit like 80% to make your battery last longer over the years.
**Power Saving**
Change power profiles and set CPU power limits to save energy when you need it.
**Cooling Control**
Control the cooling fans for laptops like Lenovo or ASUS to keep your computer quiet or cool.
**Hardware Status**
Check the status of your battery, graphics, and power all in one place.
---
## Example CLI
## How to Use It
```bash
# GPU Modes
# Graphics
lapctl gpu integrated
lapctl gpu hybrid
lapctl gpu nvidia
# Battery Controls
# Battery limit
lapctl battery limit 80
lapctl battery status
# Power Profiles
# Power mode
lapctl power performance
lapctl power balanced
lapctl power battery-save
# Raw Wattage Capping
# Power limit in Watts
lapctl power limit-tdp 35
# Cooling/Thermal Overrides (Lenovo/ASUS)
# Cooling fans
lapctl cooling performance
lapctl cooling balanced
lapctl cooling quiet
# Check All Hardware
# Check everything
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
```
---
## Built With
- Rust
- Modern Linux system interfaces
---
## Project Structure
## File Layout
```
lapctl
@@ -77,6 +73,7 @@ lapctl
├── src/
│ ├── main.rs
│ ├── cli.rs
│ ├── lib.rs
│ │
│ ├── commands/
│ │ ├── mod.rs
@@ -84,6 +81,7 @@ lapctl
│ │ ├── battery.rs
│ │ ├── power.rs
│ │ ├── cooling.rs
│ │ ├── install_rules.rs
│ │ └── status.rs
│ │
│ ├── hardware/
@@ -92,41 +90,46 @@ lapctl
│ │
│ └── utils/
│ └── system.rs
│
└── tests/
├── cli.rs
└── gpu.rs
```
## Core Capabilities
---
- [x] CLI structure and routing architecture
- [x] GPU mode switching and configuration orchestration
- [x] Battery charge limit management (sysfs & Ideapad conservation mode)
- [x] Comprehensive hardware status polling
- [x] Configuration support and state caching
- [x] Thermal/Cooling profiles (Lenovo VPC / ASUS WMI)
- [x] CPU TDP (Wattage) Control (Intel RAPL / AMD hwmon)
## Project Goals Finished
[x] CLI setup and routing
[x] Graphics switching
[x] Battery limits tools
[x] System status checking
[x] Tool configuration saving
[x] Cooling fan setup
[x] CPU power limit setup
---
## Contributing
## Contributions
Contributions, ideas, and feature suggestions are welcome.
More contribution guidelines will be added once the project reaches its first stable milestone.
We welcome your ideas and help!
To contribute, please fork the repository, create a new feature branch, and submit a Pull Request. Please ensure all tests pass by running `cargo test` before submitting your changes.
---
## Credits
## Special Credit
Special thanks to [EnvyControl](https://github.com/bayasdev/envycontrol) by bayasdev. `lapctl` drew heavily from EnvyControl's structural logic for seamlessly handling hardware configurations across Linux environments.
Special thanks to [EnvyControl](https://github.com/bayasdev/envycontrol) by bayasdev. `lapctl` uses many ideas from EnvyControl to handle graphics setup on Linux.
---
## License
This project is licensed under the **MIT License**.
This project uses the **MIT License**.
You are free to use, modify, and distribute this software under the terms of the license.
For full details, see the [LICENSE](LICENSE) file in this repository.
You can use, change, and share this software freely under the rules of the license.
Check the [LICENSE](LICENSE) file in this folder for details.
---
⭐ If you find this project interesting, consider starring the repository to follow its progress.
⭐ If you like this tool, please consider starring the repository!