Skip to main content
Version: 0.3.3

keylightd-tray

Generates a CSS theme for keylightd-tray, the Elgato Key Light system-tray applet that ships with keylightd. The output is a two-file pair — a palette file plus a theme application file — written into keylightd-tray's config directory. keylightd-tray watches its CSS files and re-renders the tray UI live as soon as the imported file changes.

Installation

Via the official plugin repository

tinct plugins install keylightd-tray

Build from source

cd contrib/plugins/output/keylightd-tray
go build -ldflags "-X main.Version=0.1.0" -o tinct-plugin-keylightd-tray
install -m 0755 tinct-plugin-keylightd-tray ~/.local/bin/

Verify

which tinct-plugin-keylightd-tray
tinct-plugin-keylightd-tray --plugin-info | jq .

The plugin uses tinct's go-plugin RPC protocol and is discovered automatically once it's on $PATH.

Quick start

tinct generate -i image -p ~/Pictures/wallpaper.jpg -o keylightd-tray

Generated files

FilePathRole
tinct-colours.css~/.config/keylightd/keylightd-tray/tinct-colours.cssPalette — raw colour values exported as --tinct-* CSS custom properties
tinct-custom.css~/.config/keylightd/keylightd-tray/tinct-custom.cssTheme application@imports the palette and maps --tinct-* onto keylightd-tray's UI variables (--bg-primary, --accent, --slider-track, …)

If XDG_CONFIG_HOME is set, both files land under $XDG_CONFIG_HOME/keylightd/keylightd-tray/ instead.

Integration

keylightd-tray loads custom.css from its config directory. To pull in the tinct theme, add a single @import line to that file (and leave it in place across regenerations — only the imported files are rewritten by tinct):

$EDITOR ~/.config/keylightd/keylightd-tray/custom.css
@import url("tinct-custom.css");

/* Your additional customisations here */

The plugin prints a reminder in --verbose mode if custom.css is missing the import.

Reload behaviour

Automatic

keylightd-tray watches its CSS files via the standard GTK file-monitor and re-renders the tray UI as soon as the imported file changes. No signal, IPC or restart is needed — regenerate with tinct and the new colours appear immediately.

Manual fallback

If the new colours don't appear, the watcher may have been disabled or the import may not be in place. Restart keylightd-tray:

pkill keylightd-tray && keylightd-tray &

Uninstall / revert

  1. Remove the import line from ~/.config/keylightd/keylightd-tray/custom.css:

    $EDITOR ~/.config/keylightd/keylightd-tray/custom.css
    # delete the @import url("tinct-custom.css"); line
  2. Delete the generated files:

    rm ~/.config/keylightd/keylightd-tray/tinct-colours.css \
    ~/.config/keylightd/keylightd-tray/tinct-custom.css
  3. Reload to drop the theme: keylightd-tray re-renders on custom.css change. If it doesn't, restart it:

    pkill keylightd-tray && keylightd-tray &
  4. External state: this plugin only writes to ~/.config/keylightd/keylightd-tray/. To also remove the plugin binary:

    tinct plugins uninstall keylightd-tray
    # or, for a source build:
    rm ~/.local/bin/tinct-plugin-keylightd-tray

Flags

FlagDefaultDescription
(none)Override the output directory via the TINCT_PLUGIN_KEYLIGHTD_TRAY_OUTPUT_DIR env var

Colour role mapping

Palette file (tinct-colours.css)

The palette exports tinct's semantic roles as --tinct-* custom properties.

CSS variableTinct role
--tinct-backgroundbackground
--tinct-foregroundforeground
--tinct-surfacesurface
--tinct-subtlesubtle
--tinct-overlayoverlay
--tinct-surface-container-lowestsurfaceContainerLowest
--tinct-surface-container-lowsurfaceContainerLow
--tinct-surface-containersurfaceContainer
--tinct-surface-container-highsurfaceContainerHigh
--tinct-surface-container-highestsurfaceContainerHighest
--tinct-border-mutedborderMuted
--tinct-outline-variantoutlineVariant
--tinct-accentaccent1 (falls back to accent)
--tinct-greengreen (falls back to accent2)
--tinct-yellowyellow (falls back to accent3)
--tinct-redred (falls back to accent4)

Theme application file (tinct-custom.css)

These map the palette onto keylightd-tray's UI variables.

keylightd-tray variablePalette variableUsed for
--bg-primary--tinct-backgroundWindow background
--bg-secondary / --bg-tertiary--tinct-surfacePanel backgrounds
--text-primary--tinct-foregroundPrimary text
--text-secondary / --text-muted--tinct-subtleSecondary text
--accent--tinct-accentSliders, interactive elements
--success--tinct-greenPower "on" indicator
--warning--tinct-yellowWarning indicators
--error--tinct-redError indicators
--surface--tinct-surfaceSurface fills
--overlay--tinct-overlayOverlay fills
--slider-track--tinct-surface-container-lowSlider track background
--input-bg--tinct-surface-container-lowestInput field background
--input-border--tinct-border-mutedInput field border
--list-item-bg--tinct-surface-container-lowestList item background

Customising the template

The plugin's CSS is generated in Go (no text/template template file), so customisation is best done by editing the generated tinct-custom.css mappings — keep tinct-colours.css untouched (it's regenerated) and add overrides in your own custom.css after the @import line:

@import url("tinct-custom.css");

/* Override after the import */
:root {
--accent: var(--tinct-accent);
--slider-track: var(--tinct-surface-container);
}

Troubleshooting

Plugin not found by tinct

which tinct-plugin-keylightd-tray
tinct plugins list | grep keylightd-tray

If the binary isn't on $PATH, reinstall via tinct plugins install keylightd-tray or symlink the source build into ~/.local/bin/.

Theme not applied

cat ~/.config/keylightd/keylightd-tray/custom.css

Ensure the file contains @import url("tinct-custom.css");. If it doesn't, add it; the plugin prints this reminder when run with --verbose.

Generated files missing

ls -l ~/.config/keylightd/keylightd-tray/tinct-*.css
tinct generate -i image -p ~/wallpaper.jpg -o keylightd-tray --verbose

Verbose mode shows the resolved output directory and any write errors.

  • waybar — status bar that also uses CSS theming.
  • keylightd — the upstream daemon and tray applet themed by this plugin.