Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Linux Night Light

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.

Features

  • 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

Requirements

  • Linux system (tested on Arch Linux)
  • Python 3.6+
  • redshift package (usually pre-installed)
  • tkinter for GUI (usually included with Python)

Installation

  1. Quick Setup:

    chmod +x setup_night_light.sh
    ./setup_night_light.sh
  2. Manual Setup:

    chmod +x night_light.py night_light_cli.py

Usage

GUI Version

# Direct execution
./night_light.py

# Or after setup
night-light-gui

The 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

Command Line Version

# Direct execution
./night_light_cli.py [command] [options]

# Or after setup
night-light [command] [options]

Available Commands:

  • on - Enable night light
  • off - Disable night light
  • toggle - Toggle night light on/off
  • status - Show current status
  • temp - Set color temperature
  • brightness - 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

Color Temperature Guide

  • 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)

Auto Mode

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)

Configuration

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"
}

Keyboard Shortcuts & Quick Access

After running the setup script:

  • GUI: Available in application menu as "Linux Night Light"
  • CLI: Available as night-light command from anywhere
  • Desktop entry: Can be launched from application launcher

Troubleshooting

  1. "redshift not found" error: Install redshift:

    # Arch Linux
    sudo pacman -S redshift
    
    # Ubuntu/Debian
    sudo apt install redshift
    
    # Fedora
    sudo dnf install redshift
  2. GUI doesn't start: Ensure tkinter is installed:

    # Most distributions include tkinter by default
    # If missing, install python3-tk package
  3. Permission errors: Make sure scripts are executable:

    chmod +x night_light.py night_light_cli.py
  4. Settings not saving: Check write permissions to home directory

Uninstallation

# 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

Similar Tools

  • 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.

About

A Linux night light application similar to Windows' blue light filter. Control screen color temperature with GUI and CLI interfaces.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages