Skip to content

nightlight ​

Night light: warms the display colors, by hand or on a schedule.

Add it to your layout with nightlight:

yaml
bar:
  layout:
    - monitor: "*"
      right: [nightlight]

General ​

FieldTypeDefaultDescription
formatstring"{{ status }}"Format string for the label.
temperatureu325000Color temperature in Kelvin when filter is enabled. Range: 1000-20000.
gammau32100Display gamma percentage when filter is enabled. Range: 0-200.
auto-scheduleboolfalseAutomatically ease the filter on and off on schedule: at dusk and dawn, following the sun at the machine's location, or at the custom hours.
scheduleNightlightSchedule"sunset-to-sunrise"What the schedule follows: the sun, from sunset to sunrise, or the custom hours. Only used when auto-schedule is on.
custom-hoursNightlightHours{...}When the custom schedule turns the filter on (from) and off (to), as HH:MM: the next day when to is not after from. Only used when schedule is custom.
transition-durationNightlightTransition15Length of the transition between day and night, in whole minutes, centered on civil dawn or dusk, or on the custom hours. 0 switches at once. Range: 0-120.
locationAutoPlace"auto"Where the schedule follows the sun: "auto" follows the system time zone's place, a place (name, latitude, longitude) pins it. Only used when auto-schedule is on and schedule is sunset-to-sunrise.
icon-offstring"ld-sun-symbolic"Icon when filter is disabled (showing normal daylight colors).
icon-onstring"ld-moon-symbolic"Icon when filter is enabled (showing warm night colors).
border-showboolfalseDisplay border around button.
icon-showbooltrueDisplay module icon.
tooltipbooltrueShow the module's state in a tooltip on hover.
label-showbooltrueDisplay label.
label-max-lengthu320Max label characters before truncation with ellipsis. Set to 0 to disable.
More about format

Placeholders ​

  • {{ status }} - Filter status (On, Off)
  • {{ temp }} - Current temperature in Kelvin (-- while off)
  • {{ gamma }} - Current gamma percentage (-- while off)
  • {{ config_temp }} - Configured temperature in Kelvin
  • {{ config_gamma }} - Configured gamma percentage

Examples ​

  • "{{ status }}" - "On"
  • "{{ temp }}K {{ gamma }}%" - "4500K 80%"
  • "{{ status }} ({{ temp }}K)" - "On (4500K)"
More about temperature

The night light card in the brightness dropdown sets it, from 1000K to 6600K in steps of 100K, next to a switch that turns the filter on and off as the module's toggle does. The card and the module show the same night light, which runs whether or not the bar shows the module. A strength or toggle the display refuses shows its error in the card and the module's tooltip.

More about auto-schedule

Transitions are centered on civil dawn and dusk (sun 6 degrees below the horizon), or on the custom hours' start and end. During polar day or night the sun's schedule keeps the filter off or on.

The location is location: a pinned place, or with "auto" the place of the system time zone ($TZ, else the zone /etc/localtime links to) in the tz database's zone.tab. A zone the database places nowhere, such as UTC or Etc/GMT+1, needs a pinned place. Without a usable location the schedule does not run; the tooltip and the log say why.

A manual click cancels a running transition, applies at once, and holds until the next transition begins.

More about location

The former latitude and longitude keys still read, as a place without a name; 0, 0 among them is taken as unset.

Colors ​

FieldTypeDefaultDescription
border-colorColorValue"yellow"Border color token.
icon-colorColorValue"auto"Icon foreground color. Auto selects based on variant for contrast.
icon-bg-colorColorValue"yellow"Icon container background color token.
label-colorColorValue"fg-default"Label text color token.
button-bg-colorColorValue"bg-surface-elevated"Button background color token.

Click actions ​

FieldTypeDefaultDescription
left-clickClickAction":toggle"Action on left click. Default toggles blue light filter.
right-clickClickAction""Action on right click.
middle-clickClickAction""Action on middle click.
scroll-upClickAction""Action on scroll up.
scroll-downClickAction""Action on scroll down.

Default configuration ​

yaml
modules:
  nightlight:
    format: '{{ status }}'
    temperature: 5000
    gamma: 100
    auto-schedule: false
    schedule: sunset-to-sunrise
    custom-hours:
      from: 21:00
      to: 07:00
    transition-duration: 15
    location: auto
    icon-off: ld-sun-symbolic
    icon-on: ld-moon-symbolic
    border-show: false
    border-color: yellow
    icon-show: true
    tooltip: true
    icon-color: auto
    icon-bg-color: yellow
    label-show: true
    label-color: fg-default
    label-max-length: 0
    button-bg-color: bg-surface-elevated
    left-click: :toggle
    right-click: ""
    middle-click: ""
    scroll-up: ""
    scroll-down: ""

Released under the MIT License.