A small Windows system tray tool to control screen brightness (10%–100%) and warmth (in Kelvin, 2000K–6500K), with one-click enable/disable and a "run at startup" option.
- Download the latest release.
- Run
DuskRay.exe.
- Install Python 3.9+ — check "Add python.exe to PATH" during install.
- Get the code, either:
- Clone with git:
git clone https://github.com/ErfanNamira/DuskRay.git cd DuskRay - Or download the ZIP: go to the DuskRay repo, click Code → Download ZIP, then extract it and open a terminal inside that folder.
- Clone with git:
- Install dependencies:
pip install -r requirements.txt - Start the app:
pythonw duskray.py
- Click the tray icon → instantly toggles warmth on/off. This is the fastest way to disable/re-enable the effect.
- Right-click the tray icon for the full menu:
- Brightness → 10% to 100%, in steps of 10.
- Warmth → Kelvin values from 6500K (neutral) down to 2000K (very warm/orange). Lower K = warmer.
- Enabled → same toggle as clicking the icon, shown as a checkbox.
- Run at startup → adds/removes a registry entry so DuskRay launches automatically when you log in to Windows.
- Exit → resets the display to normal color and closes the app.
Settings are saved automatically to %APPDATA%\DuskRay\config.json.
Compiling to a standalone exe gets you a proper icon, a small file size, and
a correct name in Task Manager / Startup Apps (running the raw .py script
via pythonw.exe would otherwise just show "pythonw.exe" there, since that's
the actual program being launched, not the registry entry name).
-
Generate the icon (only needed once, or after changing the design):
python generate_icon.pyThis creates
duskray.icofrom the same drawing code used by the tray icon, at multiple resolutions. -
Install the build tools:
pip install pyinstallerFor a smaller exe, also install UPX (grab the
-win64build) and extract it somewhere, e.g.C:\upx. -
Build:
pyinstaller --onefile --noconsole --clean --strip --name "DuskRay" ^ --icon=duskray.ico --version-file=version_info.txt ^ --upx-dir=C:\upx ^ --exclude-module tkinter --exclude-module unittest ^ --exclude-module pdb --exclude-module doctest --exclude-module test ^ duskray.py -
The result is
dist\DuskRay.exe. Run that instead of the.pyfile, and turn on "Run at startup" from its tray menu — the registry entry will point atDuskRay.exe, and Task Manager will correctly show "DuskRay" as both the process name and (from the embedded metadata) the description.
screen_brightness_control uses Windows' built-in WMI brightness API, which
reliably controls laptop built-in displays. External monitor support
depends on the monitor/drivers supporting DDC/CI — some external monitors
won't respond to software brightness changes; warmth will still work.
DuskRay adjusts the monitor's gamma ramp — the same underlying Windows mechanism used by Night Light/f.lux — using a standard color-temperature (Kelvin) approximation to compute the tint, rather than an arbitrary percentage. No overlay window is used. Turn off Windows Night Light if you use DuskRay, since two gamma-ramp tools will fight each other.
MIT