| Crates.io | healthy-monitor |
| lib.rs | healthy-monitor |
| version | 0.1.2 |
| created_at | 2024-12-31 17:03:10.643381+00 |
| updated_at | 2024-12-31 17:45:20.063869+00 |
| description | Automatically adjust monitor brightness and color temperature based on ambient light or weather |
| homepage | |
| repository | https://github.com/patrik-cihal/healthy-monitor |
| max_upload_size | |
| id | 1500192 |
| size | 74,812 |
A Rust application that automatically adjusts your monitor's brightness and color temperature based on:
xrandr command-line toolInstall directly from crates.io:
cargo install healthy-monitor
Basic usage (using webcam):
healthy-monitor
If webcam is not available, provide OpenWeather API key:
healthy-monitor --api-key YOUR_API_KEY
healthy-monitor [OPTIONS]
Options:
--api-key <API_KEY> OpenWeather API key (required only if webcam is not available)
--min-brightness <FLOAT> Minimum brightness level (0.0 to 1.0) [default: 0.6]
--day-temp <FLOAT> Color temperature during day in Kelvin [default: 6500]
--night-temp <FLOAT> Color temperature during night in Kelvin [default: 3500]
--transition-hours <FLOAT> Hours before sunset to start transitioning [default: 2.0]
--monitors <MONITORS> Comma-separated list of monitor names [default: autodetect]
-h, --help Print help
-V, --version Print version
healthy-monitor
healthy-monitor \
--min-brightness 0.4 \
--monitors "HDMI-1,DP-1"
healthy-monitor \
--api-key YOUR_API_KEY \
--min-brightness 0.4
To run healthy-monitor automatically at regular intervals:
which healthy-monitor
crontab -e
# Run every 5 minutes (with webcam)
*/5 * * * * DISPLAY=:0 /path/to/healthy-monitor
# Run every 5 minutes (with weather API fallback)
*/5 * * * * DISPLAY=:0 /path/to/healthy-monitor --api-key YOUR_API_KEY
# Run every 10 minutes during daytime with custom settings
*/10 7-22 * * * DISPLAY=:0 /path/to/healthy-monitor --min-brightness 0.4 --monitors "HDMI-1,DP-1"
Note:
/path/to/healthy-monitor with the actual path from step 1YOUR_API_KEY with your OpenWeather API keyDISPLAY=:0 is required for X11 access*/5 means "every 5 minutes"7-22 means "from 7 AM to 10 PM"man 5 crontab for more timing patternsTo find your monitor names, run:
xrandr --listmonitors
Then use these names in the --monitors option.
xrandrMIT License