Nightlight is a script for managing display color temperature to reduce blue light exposure during night-time computer use. This repository provides a simple script to adjust the color temperature of your display and integrate it with your i3 window manager configuration.
To install Nightlight, follow these steps:
-
Clone the repository:
git clone https://github.com/WilliamFerns1/i3-nightlight.git
-
Change directory into the cloned repository:
cd i3-nightlight
-
Move the script to
/usr/bin
using sudo:sudo mv nightlight /usr/bin/nightlight
-
Add the following line to your i3 configuration file (
~/.config/i3/config
):# nightlight: exec --no-startup-id nightlight start_time end_time interval_minutes >/dev/null 2>&1 &
Replace
start_time
,end_time
, andinterval_minutes
with your desired values. This command ensures that Nightlight starts automatically with your i3 session.Here is an example of a command that starts Nightlight at 8:00 PM, ends at 23:59, and looks if the current time is inbetween the start and end time, every 30 minutes: (it will not work if the end time is above 23:59. Feel free to make a PR if you want that extra functionality)
exec --no-startup-id nightlight 20:00 23:59 30 >/dev/null 2>&1 &
-
Restart your i3 session or reload the configuration file for the changes to take effect. If you don't know how, just restart your computer by running
reboot
in your terminal.
You can adjust the start time, end time, and interval for Nightlight by editing the exec
command in your i3 configuration file. Simply modify the values in the command to match your preferences.
Once installed and configured, Nightlight will automatically adjust the color temperature of your display according to the specified schedule. You can also manually run the nightlight
command in the terminal to activate it outside of the scheduled times.
Just run the command nightlight
in your terminal to see the usage.
# Example:
nightlight 20:00 23:59 30
Contributions are welcome! If you encounter any issues or have suggestions for improvements, feel free to open an issue or submit a pull request. It would be an honor if you can make the script use Redshift instead.
This project is licensed under the MIT License - see the LICENSE file for details.