A lightweight, real-time automatic screen brightness adjustment tool for Linux that uses your webcam as an ambient light sensor. Inspired by mobile device auto-brightness, but built for your Linux desktop/laptop.
- 🌈 Perceived Dominance Sensing: Intelligent luma estimation that favors diffuse environmental light over punctual sources (like lamps) using weighted histograms.
- ⚡ Lightweight and resource-efficient with half-precision optimization
- 🎯 Custom calibration for optimal accuracy
- ⚙️ Deeply configurable via TOML
- 🌙 Built-in circadian rhythm support (optimizes brightness based on time of day)
- 📊 Detailed logging and status monitoring
- 🚀 Actively developed and optimized for performance
- Rust (latest stable)
- Linux system with a webcam
- Backlight control support (
/sys/class/backlight)
-
Clone the repository
git clone https://github.com/CodeByHardik/Smart-Brightness.git cd Smart-Brightness -
Run the Interactive Installer
chmod +x install.sh ./install.sh
The installer will guide you through:
- Installing dependencies and permissions
- Selecting a daemon mode (Realtime, Boot, or Interval)
- Running initial calibration
- Setting up the systemd service
You can configure Smart Brightness in two ways:
-
Interactive TUI (Recommended)
smart-brightness --configure
This opens a visual interface to edit settings, change modes, and adjust sensitivity.
-
Manual Config Editing Edit
~/.config/smart-brightness/config.tomldirectly.
For a detailed explanation of all options, see the Configuration Guide. For a deep dive into the math and algorithms, see the Internal Logic Guide.
If you notice the brightness range is limited or ambient detection is off:
smart-brightness --calibrate- Realtime: Continuously adjusts brightness. Best for most users.
- Boot: Runs for a set duration (e.g. 5 mins) after login, then exits. Good for quick adjustment on startup without background resource usage.
- Interval: Runs for a duration, sleeps, then repeats. Good balance of power saving and responsiveness.
/etc/smart-brightness/config.toml
~/.config/smart-brightness/config.tomlwatch -n 1 cat /sys/class/backlight/*/actual_brightnessView real-time status:
journalctl -f -u smart-brightness # If running as a service
# OR
RUST_LOG=info ./target/release/smart_brightness- Basic auto-brightness functionality
- Configuration via TOML
- Calibration tool
- Systemd service daemon
- Systemd daemon fixes
- Enhancing the installation process
- Widen the scope of configuration
- Face detection integration