๐ง Complete Linux Implementation for Lenovo Legion Laptops
A comprehensive system management application for Lenovo Legion laptops running on Linux. Built with modern cross-platform technologies and native Linux integration.
- Real-time CPU/GPU temperature monitoring
- Fan speed control and monitoring
- Custom thermal profiles
- Thermal throttling detection
- Integration with hwmon and legion-laptop module
- 4-zone RGB lighting support
- Per-key RGB support (where available)
- Multiple lighting effects and patterns
- Brightness control
- Custom color profiles and animations
- Power mode switching (Quiet, Balanced, Performance, Custom)
- Battery conservation mode
- Rapid charge control
- Battery health monitoring
- Custom power limits and profiles
- Hybrid graphics mode switching (Integrated/Discrete/Auto)
- Discrete GPU enable/disable
- GPU performance monitoring
- Display refresh rate control (60Hz/144Hz/165Hz/240Hz)
- Panel overdrive settings
- Command-line interface (CLI) for automation
- System tray integration with native notifications
- Desktop notifications for status changes
- Systemd service support for background operation
- udev rules for proper hardware access
- Rule-based automation system
- Trigger-based actions (AC power, temperature, time)
- Profile switching automation
- Macro support for complex sequences
- IPC communication for external control
curl -sSL https://raw.githubusercontent.com/vivekchamoli/LenovoLegion7iLinux/main/install.sh | sudo bash# Clone repository
git clone https://github.com/vivekchamoli/LenovoLegion7iLinux.git
cd LenovoLegion7iLinux/LenovoLegionToolkit.Avalonia
# Build and install
./build-linux-complete.sh
cd publish
sudo ./install-system.sh
# Add user to legion group (required for hardware access)
sudo usermod -a -G legion $USER
# Log out and log back in, then:
legion-toolkitwget https://github.com/vivekchamoli/LenovoLegion7iLinux/releases/latest/download/legion-toolkit_3.0.0_amd64.deb
sudo dpkg -i legion-toolkit_3.0.0_amd64.deb
sudo usermod -a -G legion $USERwget https://github.com/vivekchamoli/LenovoLegion7iLinux/releases/latest/download/LegionToolkit-x86_64.AppImage
chmod +x LegionToolkit-x86_64.AppImage
./LegionToolkit-x86_64.AppImagegit clone https://github.com/vivekchamoli/LenovoLegion7iLinux.git
cd LenovoLegion7iLinux/LenovoLegionToolkit.Avalonia
./build-linux-complete.sh# Launch main application
legion-toolkit
# Launch minimized to system tray
legion-toolkit --minimized
# Launch with debug logging
legion-toolkit --debug# Show system status
legion-toolkit status
# Set power mode
legion-toolkit power-mode performance
# Control RGB lighting
legion-toolkit rgb --mode wave --color blue --brightness 80
# Monitor temperatures
legion-toolkit thermal --monitor
# Control fan speeds
legion-toolkit fan --speed 75
# Battery management
legion-toolkit battery --conservation on --rapid-charge off# Set performance mode when AC connected
legion-toolkit automation add --trigger ac-connected --action "power-mode performance"
# Reduce RGB brightness at night
legion-toolkit automation add --trigger time-22:00 --action "rgb --brightness 20"
# Temperature-based fan control
legion-toolkit automation add --trigger temp-cpu-80 --action "fan --profile performance"- Laptop: Lenovo Legion series (Gen 6+) or compatible IdeaPad Gaming
- CPU: x86_64 or ARM64 processor
- Memory: 4GB RAM (8GB recommended)
- Storage: 100MB free space
- OS: Linux kernel 5.4+ (Ubuntu 20.04+, Fedora 32+, Arch, etc.)
- Desktop: Any X11 or Wayland desktop environment
- Dependencies: Included in packages (libicu, openssl, etc.)
- legion-laptop kernel module (for advanced hardware control)
- systemd (for service management)
- pkexec/sudo (for privileged operations)
- Legion 5 Series: 5, 5i, 5 Pro (Gen 6, 7, 8, 9)
- Legion 7 Series: 7, 7i (Gen 6, 7, 8, 9)
- Legion 9 Series: 9i (Gen 9)
- IdeaPad Gaming: 3, 3i (Selected models)
- LOQ Series: 15, 16 (Selected models)
| Feature | Gen 6 | Gen 7 | Gen 8 | Gen 9 | Notes |
|---|---|---|---|---|---|
| Power Modes | โ | โ | โ | โ | Quiet/Balanced/Performance |
| Custom Mode | โ | โ | โ | โ | User-defined settings |
| Thermal Control | โ | โ | โ | โ | CPU/GPU/System temps |
| Fan Control | โ | โ | โ | โ | Manual and auto modes |
| RGB 4-Zone | โ | โ | โ | โ | Standard Legion RGB |
| RGB Per-Key | โ | โ | โ | โ | Advanced models only |
| Hybrid Graphics | โ | โ | โ | โ | Requires NVIDIA/AMD drivers |
| Battery Conservation | โ | โ | โ | โ | Extends battery life |
| Rapid Charge | โ | โ | โ | โ | Fast charging control |
| Display Control | โ | โ | โ | โ | Refresh rate switching |
# Add user to hardware access group
sudo usermod -a -G legion $USER
# Load Legion kernel module (if available)
sudo modprobe legion-laptop
# Check module status
lsmod | grep legion
# Install module permanently (Ubuntu/Debian)
echo "legion-laptop" | sudo tee -a /etc/modules- User Settings:
~/.config/legion-toolkit/ - System Settings:
/etc/legion-toolkit/ - Log Files:
~/.config/legion-toolkit/logs/ - Profiles:
~/.config/legion-toolkit/profiles/ - Automation Rules:
~/.config/legion-toolkit/automation/
# Edit configuration
legion-toolkit config --edit
# Import/Export profiles
legion-toolkit profile --export gaming.json
legion-toolkit profile --import office.json
# View hardware capabilities
legion-toolkit hardware --capabilities
# Service management
sudo systemctl enable legion-toolkit
sudo systemctl start legion-toolkit๐ซ Permission Denied Errors
# Ensure user is in legion group
groups $USER
# Re-add to legion group if missing
sudo usermod -a -G legion $USER
# Log out and log back in
# Check udev rules
ls -la /etc/udev/rules.d/99-legion-toolkit.rules
# Reload udev rules
sudo udevadm control --reload-rules
sudo udevadm trigger๐ Hardware Not Detected
# Check for legion module
sudo modprobe legion-laptop
lsmod | grep legion
# Check hardware paths
ls -la /sys/kernel/legion_laptop/ 2>/dev/null || echo "Module not loaded"
ls -la /sys/class/hwmon/
# Test basic functionality
legion-toolkit hardware --detect๐ฅ๏ธ GUI Not Starting
# Try CLI mode first
legion-toolkit --help
# Check display environment
echo $DISPLAY
echo $WAYLAND_DISPLAY
# Check dependencies
ldd $(which legion-toolkit) | grep "not found"
# Run with debugging
legion-toolkit --debug --verbose๐ง Build Issues
# Install .NET 8 SDK
sudo apt update && sudo apt install dotnet-sdk-8.0
# Clear build cache
dotnet clean
rm -rf bin/ obj/
# Rebuild
dotnet restore
dotnet build --configuration ReleaseWe welcome contributions! Here's how to get started:
# Fork and clone repository
git clone https://github.com/vivekchamoli/LenovoLegion7iLinux.git
cd LenovoLegion7iLinux
# Install development dependencies
sudo apt install dotnet-sdk-8.0 git build-essential
# Set up development environment
cd LenovoLegionToolkit.Avalonia
dotnet restore
dotnet buildLenovoLegionToolkit.Avalonia/
โโโ Services/Linux/ # Linux-specific service implementations
โโโ Views/ # Avalonia UI views and windows
โโโ ViewModels/ # MVVM view models and logic
โโโ Models/ # Data models and enums
โโโ Utils/ # Platform utilities and helpers
โโโ CLI/ # Command-line interface commands
โโโ IPC/ # Inter-process communication
โโโ Resources/ # Application resources and assets
โโโ SystemTray/ # System tray integration
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow existing code style and patterns
- Add appropriate logging for debugging
- Test on real Legion hardware when possible
- Update documentation for new features
- Consider backward compatibility
- ๐ User Manual - Complete usage guide
- ๐ง Build Instructions - Building from source
- โก CLI Reference - Command-line interface
- ๐ค Automation Guide - Setting up automation
- ๐ Troubleshooting - Common issues and solutions
- ๐ป Development Guide - Contributing and development
- Complete Linux GUI application
- Hardware detection and control
- RGB keyboard support
- Power management
- CLI interface and automation
- Professional packaging
- Flatpak packaging
- Enhanced automation system
- Performance monitoring dashboard
- Custom keyboard layouts
- Mobile companion app
- Web interface for remote control
- Plugin system for extensions
- Advanced RGB effects editor
- Game integration features
- Cloud profile synchronization
This project is licensed under the MIT License - see the LICENSE file for details.
Vivek Chamoli
- Email: vivekchamoli@outlook.com
- GitHub: @vivekchamoli
- LinkedIn: Vivek Chamoli
- Original Windows Implementation: BartoszCichecki and contributors
- legion-laptop Kernel Module: Linux kernel maintainers and contributors
- Avalonia UI Framework: Cross-platform .NET UI framework team
- Community: Beta testers and feature contributors
If you find this project useful, please consider:
- โญ Starring the repository
- ๐ Reporting bugs and issues
- ๐ก Suggesting new features
- ๐ค Contributing code or documentation
- ๐ข Sharing with other Legion users
๐ง Made with โค๏ธ for the Linux Community
Report Bug โข Request Feature โข Discussions
