Atv0.3.0Repositorytessera
Document

Nightlight

Tessera can warm your screens in the evening and bring them back to their daytime colors in the morning. It calculates sunrise and sunset locally, so you don't need a location service or a network connection.

Add a nightlight: value to your configuration:

(import (tessera config))
(config-with default-config
  nightlight: (nightlight location: '(37.983810 23.727539)
                          day: 6500 night: 3500
                          brightness: '(1.0 0.7)
                          transition: 1800))

The location is latitude followed by longitude, in degrees. South and west are negative. The temperatures are in kelvin, and brightness: gives the day and night multipliers. This changes the color ramps; your monitor's backlight setting stays where you put it.

Temperatures can range from 1000 to 25000 K, brightness from 0.1 to 1.0, and transition duration from 0 to 43200 seconds. The defaults are 6500 K by day, 3500 K at night, full brightness, and a 30-minute transition.

If you'd prefer a fixed schedule, replace location: with times: '("18:30" "07:00"): dusk first, then dawn, in local time. Choose one schedule. transition: is the total number of seconds centered on each boundary; 1800 starts changing 15 minutes before it and finishes 15 minutes after it. Set it to 0 for an immediate change. Fixed schedules follow the local timezone and daylight saving time. At polar locations, dates without a sunrise or sunset use the corresponding full day or night value.

By default, every output participates. You can limit the schedule with outputs: '("DP-2" "eDP-2"). Outputs outside that list receive a neutral ramp. Omit nightlight: or set it to #f to disable the schedule. Tessera resets new outputs to neutral, or applies the current nightlight value, when it takes them over. A warm ramp from a previous compositor shouldn't follow you into a fresh session. Tessera also restores neutral ramps before a clean exit on outputs without an external gamma-control client.

Change it while you're working

tessera nightlight
tessera nightlight on
tessera nightlight off
tessera nightlight auto

The first command reports each output's applied state, temperature, brightness and selected mode. on uses the configured night value; off restores neutral 6500 K at full brightness; auto returns to your schedule. You need a nightlight configuration before using on. Mode changes last for the session. The schedule recalculates from the current clock after suspend or a clock adjustment.

From the REPL or a configuration action, use (set-nightlight! 'on), (set-nightlight! 'off) or (set-nightlight! 'auto). These queue a change on the policy loop. (nightlight-status) returns the applied per-output records.

What the bar tells you

(nightlight-section) reads the compositor's applied state for its output. It shows Nightlight on with the current kelvin, Nightlight off, or Nightlight external. Until a native commit confirms a ramp, it reports Nightlight unknown. An output without gamma support, or one that rejects the ramp, reports Nightlight unavailable. Headless outputs usually have no gamma table, so they can't demonstrate a physical change in screen color.

The older (night-light-section) spelling remains as a deprecated alias. An explicit source: on that older section retains its existing transport.

An external gamma-control client, such as gammastep, takes precedence on each output it holds. Tessera leaves that output to the client, then resumes the current schedule when the client releases it. There's no reason to start gammastep alongside the built-in schedule, but a client can still take control when you ask it to.

On Wayland, gammastep -x resets gamma, then keeps running to hold it; end it with Ctrl+C. Use tessera nightlight off for the built-in neutral setting. If an external client still owns an output, release that client before expecting the built-in setting to apply.