Skip to main content
Version: 0.3.3

swayosd

Generates a GTK CSS stylesheet for SwayOSD, the on-screen-display server for Sway and other wlroots compositors. The output is a single style.css at SwayOSD's default config location, which the daemon loads automatically on startup.

Installation

Built into tinct — nothing to install separately. tinct generate -o swayosd works out of the box.

Quick start

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

Generated files

FilePathRole
style.css~/.config/swayosd/style.cssGTK CSS for the OSD popup: rounded pill window, text/icon colour, progress bar fill and track. Includes commented examples for volume/brightness/caps-lock variants.

Generated format

/* SwayOSD theme generated by tinct */

window {
background-color: rgba(30, 30, 46, 0.9);
border-radius: 16px;
border: 2px solid #89b4fa;
}

.container {
margin: 16px;
}

progressbar {
min-height: 6px;
border-radius: 3px;
background-color: #313244;
}

progressbar progress {
background-color: #89b4fa;
border-radius: 3px;
}

image {
color: #cdd6f4;
}

Integration

No manual configuration required. SwayOSD automatically loads ~/.config/swayosd/style.css on startup. The plugin writes directly to that location.

If you launch SwayOSD with --style pointing elsewhere, generate into that directory instead:

tinct generate -o swayosd --swayosd.output-dir ~/.config/swayosd/custom

…and start SwayOSD with swayosd-server --style ~/.config/swayosd/custom/style.css.

Reload behaviour

Automatic

None. SwayOSD reads its stylesheet when the server starts; there is no live reload signal.

Manual fallback

Restart the SwayOSD server to pick up the new stylesheet:

pkill swayosd-server && swayosd-server &

Or, if you run it under systemd:

systemctl --user restart swayosd

Uninstall / revert

  1. Remove the config line: none added. SwayOSD auto-discovers ~/.config/swayosd/style.css, so no edits to any other file ever happened.

  2. Delete the generated file:

    rm ~/.config/swayosd/style.css
  3. Reload to drop the theme:

    pkill swayosd-server && swayosd-server &
  4. External state: this plugin only writes to ~/.config/swayosd/. No further cleanup is required.

Flags

FlagDefaultDescription
--swayosd.output-dir~/.config/swayosdOverride the output directory

Colour role mapping

GTK CSS values are emitted in rgba(r, g, b, a) format.

SelectorPropertyTinct roleNotes
window#osdbackgroundbackground @ 0.85Pill-shaped OSD window.
window#osd image, window#osd labelcolorforegroundIcons and text inside the OSD.
window#osd troughbackgroundforegroundMuted @ 0.30Progress-bar track.
window#osd progressbackgroundaccent1Progress-bar fill.

The template ships commented-out variants for window#osd.volume, window#osd.brightness and window#osd.caps-lock (mapping to accent3, warning, and warning respectively) — uncomment them to colour those OSD types differently.

Customising the template

Extract the default template to override it:

tinct plugins templates dump -o swayosd -l ~/.config/tinct/templates/swayosd

This creates ~/.config/tinct/templates/swayosd/style.css.tmpl. Tinct uses your version in preference to the embedded default.

See the templating reference for the available functions and palette accessors.

Troubleshooting

Theme not visible after generation

SwayOSD only reads style.css at startup. Restart the server (pkill swayosd-server && swayosd-server & or systemctl --user restart swayosd) and trigger an OSD (volume key, caps-lock) to see the new colours.

swayosd-client: command not found

The plugin lists swayosd-client as a required binary because it's the standard way to confirm SwayOSD is installed (the daemon binary is swayosd-server). Install the SwayOSD package via your distro and both should appear.

OSD background is fully opaque

SwayOSD's pill background uses rgba(..., 0.85) so the wallpaper shows through. If yours is opaque, your compositor isn't applying client-side transparency to GTK4 surfaces. Check your compositor's transparency rules or extract the template and bump the alpha to taste.

  • dunst — notification daemon, often configured alongside an OSD.
  • waybar — status bar, the other always-on overlay on most wlroots desktops.