A Linux night light application similar to Windows' blue light filter. This tool helps reduce eye strain by adjusting your screen's color temperature, making it warmer (more orange/red) during evening hours.
- GUI Application: Easy-to-use graphical interface with sliders for real-time adjustment
- Command Line Interface: Terminal-based control for power users and scripting
- Color Temperature Control: Adjust from 1000K (very warm/orange) to 6500K (cool/blue)
- Brightness Control: Adjust screen brightness from 10% to 100%
- Auto Mode: Automatically enable/disable based on sunset and sunrise times
- Persistent Settings: Your preferences are saved and restored
- System Integration: Optional desktop entry and PATH integration
- Linux system (tested on Arch Linux)
- Python 3.6+
redshiftpackage (usually pre-installed)tkinterfor GUI (usually included with Python)
-
Quick Setup:
chmod +x setup_night_light.sh ./setup_night_light.sh
-
Manual Setup:
chmod +x night_light.py night_light_cli.py
# Direct execution
./night_light.py
# Or after setup
night-light-guiThe GUI provides:
- Enable/disable toggle
- Temperature slider (1000K - 6500K)
- Brightness slider (10% - 100%)
- Auto mode with customizable sunset/sunrise times
- Real-time status display
- Apply/Reset/Exit buttons
# Direct execution
./night_light_cli.py [command] [options]
# Or after setup
night-light [command] [options]Available Commands:
on- Enable night lightoff- Disable night lighttoggle- Toggle night light on/offstatus- Show current statustemp- Set color temperaturebrightness- Set brightness level
Options:
-t, --temperature TEMP- Color temperature in Kelvin (1000-6500)-b, --brightness BRIGHT- Brightness level (0.1-1.0)
Examples:
# Enable with default settings
night-light on
# Enable with custom temperature and brightness
night-light on -t 2500 -b 0.8
# Set temperature to 3000K
night-light temp -t 3000
# Set brightness to 70%
night-light brightness -b 0.7
# Check current status
night-light status
# Toggle on/off
night-light toggle- 6500K: Cool daylight (normal screen)
- 5000K: Neutral white
- 4000K: Warm white
- 3000K: Soft warm (recommended for evening)
- 2500K: Very warm (recommended for night)
- 2000K: Candlelight warm
- 1000K: Very orange/red (maximum warmth)
The GUI version supports automatic scheduling:
- Set your preferred sunset and sunrise times
- Night light will automatically enable at sunset
- Night light will automatically disable at sunrise
- Times are in 24-hour format (e.g., "18:00" for 6 PM)
Settings are automatically saved to ~/.night_light_config.json:
{
"enabled": false,
"temperature": 3000,
"brightness": 1.0,
"auto_mode": false,
"sunset_time": "18:00",
"sunrise_time": "06:00"
}After running the setup script:
- GUI: Available in application menu as "Linux Night Light"
- CLI: Available as
night-lightcommand from anywhere - Desktop entry: Can be launched from application launcher
-
"redshift not found" error: Install redshift:
# Arch Linux sudo pacman -S redshift # Ubuntu/Debian sudo apt install redshift # Fedora sudo dnf install redshift
-
GUI doesn't start: Ensure tkinter is installed:
# Most distributions include tkinter by default # If missing, install python3-tk package
-
Permission errors: Make sure scripts are executable:
chmod +x night_light.py night_light_cli.py
-
Settings not saving: Check write permissions to home directory
# Remove symlinks
rm -f ~/.local/bin/night-light-gui ~/.local/bin/night-light
# Remove desktop entry
rm -f ~/.local/share/applications/night-light.desktop
# Remove config file (optional)
rm -f ~/.night_light_config.json
# Reset screen
redshift -x- redshift: The underlying tool this GUI wraps
- f.lux: Popular Windows/Mac alternative
- GNOME Night Light: Built into GNOME desktop
- KDE Night Color: Built into KDE Plasma
This tool provides a standalone solution that works across different desktop environments.