Skip to content

Button Themes and SVG Masks

github-actions[bot] edited this page Nov 27, 2026 · 1 revision

Button themes and SVG masks

Vectorator supports three rendering modes for window control buttons: bundled full-colour Catppuccin Mocha SVGs, custom single-file SVG alpha masks, and procedural Cairo fallbacks.

Bundled Catppuccin Mocha controls

When a button_*_svg option is empty, Vectorator loads full-colour SVG assets from <datadir>/vectorator/buttons/. Installation ships 24 SVG files covering 4 controls (minimize, maximize, restore, close) across 6 states each:

State Filename pattern Active behaviour Inactive behaviour
Active normal <control>.svg Solid coloured circle, no glyph Not applicable
Active hover <control>-hover.svg Solid coloured circle with white glyph Not applicable
Active pressed <control>-pressed.svg Darkened coloured circle with white glyph Not applicable
Inactive normal <control>-inactive.svg Not applicable Translucent circle, no glyph
Inactive hover <control>-inactive-hover.svg Not applicable Translucent circle with translucent glyph
Inactive pressed <control>-inactive-pressed.svg Not applicable Matches inactive hover

Bundled full-colour assets ignore button_color, button_inactive_color, button_hover_color, and button_pressed_color.

Bundled SVG hex palette

These exact values come from the installed assets/buttons/*.svg files:

Element Hex value Opacity
Active minimise circle (normal and hover) #f9e2af 1.0
Active minimise circle (pressed) #d9caaa 1.0
Active maximise and restore circles (normal and hover) #a6e3a1 1.0
Active maximise and restore circles (pressed) #a2cba0 1.0
Active close circle (normal and hover) #f38ba8 1.0
Active close circle (pressed) #d591a5 1.0
Active hover and pressed glyphs #ffffff 1.0
Inactive circles (all states) #eff1f5 0.3
Inactive hover and pressed glyphs #eff1f5 0.5

Custom SVG alpha masks

Configure one or more button_*_svg paths to replace the bundled controls:

  • button_minimize_svg
  • button_maximize_svg
  • button_restore_svg
  • button_close_svg

Each configured path overrides all 6 states for that control. You can override one control while keeping bundled assets for the others.

How alpha-mask recolouring works

Vectorator renders a custom SVG into an offscreen Cairo mask and uses only its alpha channel. Fill colours inside the SVG file do not affect the final colour.

  1. For hover and pressed states, Vectorator first draws a circular (or pill-shaped) background filled with button_hover_color or button_pressed_color.
  2. Vectorator paints the SVG alpha mask with button_color on focused windows or button_inactive_color on unfocused windows.
  3. If both the glyph colour and the hover or pressed background colour are opaque (alpha == 1.0) and their WCAG contrast ratio is below 4.5, Vectorator automatically switches the glyph to pure black or pure white so the control stays readable.

Default custom-mask and fallback palette

The four colour options default to Catppuccin Mocha values in metadata/vectorator.xml:

Option Default RGBA Hex equivalent Role
button_color 0.803922 0.839216 0.956863 1.0 #cdd6f4 Active glyph colour
button_inactive_color 0.529412 0.533333 0.572549 1.0 #878892 Inactive glyph colour
button_hover_color 0.192157 0.196078 0.266667 1.0 #313244 Hover background colour
button_pressed_color 0.270588 0.278431 0.352941 1.0 #45475a Pressed background colour

Example custom mask configuration

[vectorator]
button_minimize_svg = /home/user/.config/wayfire/icons/minimize.svg
button_maximize_svg = /home/user/.config/wayfire/icons/maximize.svg
button_restore_svg = /home/user/.config/wayfire/icons/restore.svg
button_close_svg = /home/user/.config/wayfire/icons/close.svg

button_color = 0.803922 0.839216 0.956863 1.0
button_inactive_color = 0.529412 0.533333 0.572549 1.0
button_hover_color = 0.192157 0.196078 0.266667 1.0
button_pressed_color = 0.270588 0.278431 0.352941 1.0

Procedural fallback controls

If any bundled asset or custom SVG path is missing, unreadable, invalid XML, or renders completely transparent, Vectorator draws a procedural Cairo glyph for that exact state:

  • Close draws an X.
  • Minimise draws a bottom horizontal bar.
  • Maximise draws a square outline.
  • Restore draws two overlapping squares.

Procedural fallbacks use the same four palette options (button_color, button_inactive_color, button_hover_color, button_pressed_color) and the same 4.5 contrast guard. Set button_line_thickness (default 0.7) to control the logical stroke width. Vectorator multiplies button_line_thickness by the output scale factor on HiDPI displays.

Live reload

Vectorator watches all four button_*_svg options and all four button_*_color options. Updating a file path or palette colour in WCM or wayfire.ini reloads the affected control and invalidates cached textures without restarting Wayfire.