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
| File | Path | Role |
|---|---|---|
style.css | ~/.config/swayosd/style.css | GTK 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
-
Remove the config line: none added. SwayOSD auto-discovers
~/.config/swayosd/style.css, so no edits to any other file ever happened. -
Delete the generated file:
rm ~/.config/swayosd/style.css -
Reload to drop the theme:
pkill swayosd-server && swayosd-server & -
External state: this plugin only writes to
~/.config/swayosd/. No further cleanup is required.
Flags
| Flag | Default | Description |
|---|---|---|
--swayosd.output-dir | ~/.config/swayosd | Override the output directory |
Colour role mapping
GTK CSS values are emitted in rgba(r, g, b, a) format.
| Selector | Property | Tinct role | Notes |
|---|---|---|---|
window#osd | background | background @ 0.85 | Pill-shaped OSD window. |
window#osd image, window#osd label | color | foreground | Icons and text inside the OSD. |
window#osd trough | background | foregroundMuted @ 0.30 | Progress-bar track. |
window#osd progress | background | accent1 | Progress-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.