Skip to content

Ckrest/night-mode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Night Mode

AI-assisted development with Claude

A blue light filter and bedtime notification service for Wayland. Wraps wlsunset with configurable schedules and desktop notifications to help maintain healthy sleep habits.

Features

  • Blue Light Filtering - Automatic warm screen tint after sunset
  • Bedtime Notifications - Reminders when it's time to sleep
  • Configurable Schedule - Set your own times for blue light, bedtime, and wake
  • Smooth Transitions - Optional gradual color temperature changes
  • Desktop Integration - Uses standard notify-send for notifications

Requirements

  • Python 3.8+
  • wlsunset (Wayland blue light filter)
  • notify-send (usually pre-installed)
# Ubuntu/Debian
sudo apt install wlsunset libnotify-bin

# Arch Linux
sudo pacman -S wlsunset libnotify

# Fedora
sudo dnf install wlsunset libnotify

Installation

  1. Clone the repository
  2. Copy example config: cp config.toml.example config.toml
  3. Edit config.toml with your preferred schedule

Configuration

Edit config.toml:

[schedule]
blue_light_start = "20:00"  # When to warm the screen
bedtime = "23:00"           # When to send bedtime notification
wake_time = "07:00"         # When to restore normal temperature
transition_minutes = 30     # Gradual transition (0 = instant)

[temperature]
day = 6500    # Normal temperature (Kelvin)
night = 3000  # Warm temperature (lower = warmer)

[notifications]
enabled = true
blue_light_message = "Blue light filter activated"
bedtime_message = "Time for bed!"
bedtime_warning_minutes = 15  # Warning before bedtime

Usage

# Run directly
python night-mode.py

# Or as a service
systemctl --user start night-mode

Running as a Service

# ~/.config/systemd/user/night-mode.service
[Unit]
Description=Night Mode Service
After=graphical-session.target

[Service]
ExecStart=/usr/bin/python3 /path/to/night-mode.py
Restart=on-failure
WorkingDirectory=/path/to/night-mode

[Install]
WantedBy=graphical-session.target
systemctl --user enable --now night-mode

How It Works

  1. Starts wlsunset with your configured schedule
  2. Runs a notification scheduler that checks the clock
  3. Sends notifications at blue light time, warning time, and bedtime
  4. Resets tracking at midnight for the next day

Built With

  • Python
  • wlsunset
  • notify-send

License

MIT License - see LICENSE for details.

About

Blue light filter and bedtime notification service for Wayland using wlsunset.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages