Automatic screen temperature adjustment tool for Hyprland, intelligently adjusting your display's colour temperature based on the time of day, weather conditions, and location.
- Automatic temperature adjustment based on time of day and weather
- Location-aware using IP geolocation
- Weather integration with OpenWeatherMap API
- Manual and automatic modes with easy toggling
- Blue light filter for reduced eye strain
- Desktop notifications for status updates
- Comprehensive logging for troubleshooting
- Hyprland window manager
- hyprsunset - Hyprland's screen temperature adjustment tool
- Python 3.6+
- notify-send (libnotify) for notifications
sudo pacman -S hyprsunset python python-requests# Install hyprsunset from source (see hyprsunset documentation)
sudo apt install python3 python3-pip python3-requests libnotify-bin# Clone the repository
git clone https://github.com/YOUR_USERNAME/hypr-py-light.git
cd hypr-py-light
chmod +x hypr-py-light.pyRun the script for initial configuration:
./hypr-py-light.pyYou'll be prompted to enter API keys for:
- OpenWeatherMap API (for weather data)
- Get a free API key at: https://openweathermap.org/api
- Used for weather-based temperature adjustments
- IP Geolocation API (for location detection)
- Get a free API key at: https://ipgeolocation.io/
- Used to determine your location automatically
Edit ~/.config/hypr-py-light/config.ini:
[API]
openweather = your_openweather_api_key_here
ipgeolocation = your_ipgeolocation_api_key_here# Show current status
hypr-py-light status
# Toggle between manual and automatic modes
hypr-py-light manual
# Force automatic mode
hypr-py-light auto
# Force manual mode
hypr-py-light force-manual
# Toggle blue light filter (manual mode only)
hypr-py-light toggle
# Refresh location data
hypr-py-light refresh-location
# Test with specific temperature
hypr-py-light test 4500
# Run as a background daemon
hypr-py-light- Day Clear: 6500K (neutral white)
- Day Cloudy: 5800K (slightly warm)
- Day Rainy: 5200K (warm)
- Night Default: 4600K (warmer)
- Night Cold: 4200K (very warm)
- Manual Blue Light On: 5000K
- Manual Blue Light Off: 6500K
Add to your hyprland.conf:
# Start hypr-py-light automatically
exec-once = /path-to-blue-light.py
# Keybindings
bind = SUPER, F5, exec, ~/path-to-hypr-py-light toggle # Toggle blue light in manual mode
bind = SUPER, F6, exec, ~/path-to-hypr-py-light manual # Toggle mode (auto/manual)
bind = SUPER, F7, exec, ~/path-to-hypr-py-light status # Show status- Configuration:
~/.config/hypr-py-light/config.ini - State:
~/.config/hypr-py-light/state.json - Logs:
~/.config/hypr-py-light/hyprlight.log - Cache:
~/.config/hypr-py-light/cache/
"hyprsunset command not found"
- Install hyprsunset:
sudo pacman -S hyprsunset (Arch) or build from source
Temperature not changing
- Check if hyprsunset is running:
pgrep hyprsunset - Check logs: tail
~/.config/hypr-py-light/hyprlight.log - Verify API keys in config file
Location detection not working
- Check internet connection
- Verify IP Geolocation API key
- Use
refresh-locationcommand
Service not starting
- Check systemd logs:
journalctl --user -u hypr-py-light.service - Ensure script has execute permissions
- Verify Python dependencies are installed
Check detailed logs:
tail -f ~/.config/hypr-py-light/hyprlight.logContributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss the changes you would like to make.
- Fork the repository
- Create your feature branch
(git checkout -b feature/AmazingFeature) - Commit your changes
(git commit -m 'Add some AmazingFeature') - Push to the branch
(git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Hyprland - The amazing window manager
- hyprsunset - Screen temperature adjustment tool
- OpenWeatherMap - Weather data API
- IP Geolocation - Location detection API
=========================================================
๐ LOCATION & WEATHER
Location: London, United Kingdom
Weather: Clear (Clear Sky)
Temperature: 18.5ยฐC
Time: Day
๐ฅ๏ธ SCREEN SETTINGS
Screen Temperature: 6500K
Mode: Automatic
Blue Light Filter: OFF
๐ FILES
Config: /home/user/.config/hypr-py-light/config.ini
State: /home/user/.config/hypr-py-light/state.json
Logs: /home/user/.config/hypr-py-light/hyprlight.log
==========================================================
- v1.0.0 - Initial release with automatic temperature adjustment
Made with โค๏ธ for the Hyprland community