Documentation
¶
Overview ¶
Package output provides the interface and base types for output plugins.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DualThemePlugin ¶ added in v0.1.1
type DualThemePlugin interface {
// GenerateDualTheme creates output files for both light and dark themes.
// primaryTheme is the main theme (based on input source).
// alternateTheme is the opposite variant (light if primary is dark, vice versa).
// Returns map of filename -> content for all generated files.
GenerateDualTheme(primaryTheme, alternateTheme *colour.ThemeData) (map[string][]byte, error)
}
DualThemePlugin is an optional interface that plugins can implement to support generating both light and dark theme variants in a single execution.
This is useful for desktop environments and applications that automatically switch themes based on system preference (e.g., KDE Plasma, Qt applications).
When this interface is implemented:
- GenerateDualTheme() is called instead of Generate()
- The plugin receives both the primary theme and its alternate variant
- The plugin can generate configuration files for both themes at once
Example: KDE Plasma generates both TinctDark.colors and TinctLight.colors, allowing seamless switching via system settings.
type ExecutionContext ¶
type ExecutionContext struct {
DryRun bool // Whether this is a dry-run
Verbose bool // Whether verbose output is enabled
OutputDir string // The output directory being used
WallpaperPath string // Optional path to source wallpaper (from input plugin)
}
ExecutionContext provides context for hook execution.
type FlagHelp ¶ added in v0.1.10
FlagHelp is re-exported from pkg/plugin for convenience. This allows output plugins to use output.FlagHelp instead of importing protocol directly.
type Plugin ¶
type Plugin interface {
// Name returns the plugin's name (e.g., "tailwind", "hyprland").
Name() string
// Description returns a human-readable description of the plugin.
Description() string
// Version returns the plugin version (e.g., "1.0.0").
Version() string
// Generate creates output file(s) from the given theme data.
// Returns map of filename -> content to support plugins that generate multiple files.
Generate(themeData *colour.ThemeData) (map[string][]byte, error)
// RegisterFlags registers plugin-specific flags with cobra command.
RegisterFlags(cmd *cobra.Command)
// Validate checks if the plugin configuration is valid.
Validate() error
// DefaultOutputDir returns the default output directory for this plugin.
DefaultOutputDir() string
// GetFlagHelp returns help information for plugin-specific flags.
// This allows dynamic help generation based on selected plugins.
GetFlagHelp() []FlagHelp
}
Plugin represents an output plugin that can generate configuration files. from a categorised colour palette.
type PostExecuteHook ¶
type PostExecuteHook interface {
// PostExecute runs after successful Generate() and file writing.
// The execCtx contains execution context including wallpaper path if available.
// The writtenFiles contains the paths that were written.
// Errors are logged but don't fail the overall operation.
PostExecute(ctx context.Context, execCtx ExecutionContext, writtenFiles []string) error
}
PostExecuteHook is an optional interface that plugins can implement to perform. actions after successful file generation.
Common use cases:.
- Reload application configuration
- Send signals to running processes
- Restart services
- Notify users of changes
- Set wallpaper (when --set-wallpaper flag is used)
type PreExecuteHook ¶
type PreExecuteHook interface {
// PreExecute runs before Generate(). Returns:.
// - skip: if true, plugin is skipped (not an error, just bypassed)
// - reason: human-readable explanation for skipping
// - error: actual error that should stop execution
PreExecute(ctx context.Context) (skip bool, reason string, err error)
}
PreExecuteHook is an optional interface that plugins can implement to perform. checks before generation. If the hook returns an error or skip=true, the plugin will be skipped without generating output.
Common use cases:.
- Check if required executables exist on $PATH
- Verify configuration directories exist
- Validate environment prerequisites
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry holds all registered output plugins.
type TemplateProvider ¶
type TemplateProvider interface {
// GetEmbeddedFS returns the embedded filesystem containing template files.
// This should return the same embed.FS used by the plugin's generateTheme method.
GetEmbeddedFS() any
}
TemplateProvider is an optional interface that plugins can implement to expose. their embedded template filesystem for template management commands.
type VerbosePlugin ¶
type VerbosePlugin interface {
// SetVerbose enables or disables verbose logging for the plugin.
SetVerbose(verbose bool)
}
VerbosePlugin is an optional interface that plugins can implement to receive. verbose logging settings from the CLI.
type VersionedPlugin ¶ added in v0.1.20
type VersionedPlugin interface {
// GetTargetVersion returns the version of the target application.
// Returns an empty string if the version cannot be determined.
// The version string should be in semantic version format (e.g., "0.53.0").
GetTargetVersion() string
}
VersionedPlugin is an optional interface that plugins can implement to support version-specific templates. When implemented, the template loader will select the most appropriate template based on the target application's version.
This is useful for applications that change their configuration format between versions (e.g., Hyprland's windowrule syntax changed in v0.53).
When this interface is implemented:
- GetTargetVersion() is called to get the installed application version
- Templates can be organized in version subdirectories (e.g., templates/0.53/)
- The loader selects the highest version that doesn't exceed the target version
- Falls back to default templates if no suitable versioned template is found
Example directory structure:
internal/plugin/output/hyprland/
├── tinct.conf.tmpl # Default template (for older versions)
└── templates/
└── 0.53/
└── tinct.conf.tmpl # Template for v0.53+
Directories
¶
| Path | Synopsis |
|---|---|
|
Package alacritty provides an output plugin for Alacritty terminal colour themes.
|
Package alacritty provides an output plugin for Alacritty terminal colour themes. |
|
Package awww provides an output plugin for awww (An Answer to your Wayland Wallpaper Woes) wallpaper daemon.
|
Package awww provides an output plugin for awww (An Answer to your Wayland Wallpaper Woes) wallpaper daemon. |
|
Package dunst provides an output plugin for Dunst notification daemon colour themes.
|
Package dunst provides an output plugin for Dunst notification daemon colour themes. |
|
Package fuzzel provides an output plugin for Fuzzel application launcher colour themes.
|
Package fuzzel provides an output plugin for Fuzzel application launcher colour themes. |
|
Package ghostty provides an output plugin for Ghostty terminal emulator colour themes.
|
Package ghostty provides an output plugin for Ghostty terminal emulator colour themes. |
|
Package gnomeshell provides an output plugin for GNOME Shell theming.
|
Package gnomeshell provides an output plugin for GNOME Shell theming. |
|
Package gtk3 provides an output plugin for GTK3 application theming.
|
Package gtk3 provides an output plugin for GTK3 application theming. |
|
Package gtk4 provides an output plugin for GTK4 application theming.
|
Package gtk4 provides an output plugin for GTK4 application theming. |
|
Package histui provides an output plugin for histui notification daemon CSS themes.
|
Package histui provides an output plugin for histui notification daemon CSS themes. |
|
Package hyprland provides an output plugin for Hyprland window manager colour themes.
|
Package hyprland provides an output plugin for Hyprland window manager colour themes. |
|
Package hyprlock provides an output plugin for Hyprlock screen lock colour themes.
|
Package hyprlock provides an output plugin for Hyprlock screen lock colour themes. |
|
Package hyprpaper provides an output plugin for Hyprpaper wallpaper manager configuration.
|
Package hyprpaper provides an output plugin for Hyprpaper wallpaper manager configuration. |
|
Package kdeplasma provides an output plugin for KDE Plasma desktop environment theming.
|
Package kdeplasma provides an output plugin for KDE Plasma desktop environment theming. |
|
Package kitty provides an output plugin for Kitty terminal colour themes.
|
Package kitty provides an output plugin for Kitty terminal colour themes. |
|
Package konsole provides an output plugin for Konsole terminal color themes.
|
Package konsole provides an output plugin for Konsole terminal color themes. |
|
Package libadwaita provides an output plugin for libadwaita/GNOME application theming.
|
Package libadwaita provides an output plugin for libadwaita/GNOME application theming. |
|
Package markdown provides an output plugin for exporting themes to markdown format.
|
Package markdown provides an output plugin for exporting themes to markdown format. |
|
Package mc provides an output plugin for Midnight Commander (mc) skin themes.
|
Package mc provides an output plugin for Midnight Commander (mc) skin themes. |
|
Package neovim provides an output plugin for Neovim colour themes.
|
Package neovim provides an output plugin for Neovim colour themes. |
|
Package ptyxis provides an output plugin for Ptyxis terminal color palettes.
|
Package ptyxis provides an output plugin for Ptyxis terminal color palettes. |
|
Package qt5 provides an output plugin for Qt5 application theming via qt5ct.
|
Package qt5 provides an output plugin for Qt5 application theming via qt5ct. |
|
Package qt6 provides an output plugin for Qt6 application theming via qt6ct.
|
Package qt6 provides an output plugin for Qt6 application theming via qt6ct. |
|
Package rosec provides an output plugin for rosec-prompt theme configuration.
|
Package rosec provides an output plugin for rosec-prompt theme configuration. |
|
shared
|
|
|
dbus_kde
Package dbus_kde provides D-Bus helpers for KDE Plasma configuration reload.
|
Package dbus_kde provides D-Bus helpers for KDE Plasma configuration reload. |
|
testing
Package testing provides shared test utilities for output plugins.
|
Package testing provides shared test utilities for output plugins. |
|
utils
Package common provides shared utilities for output plugins.
|
Package common provides shared utilities for output plugins. |
|
Package swayosd provides an output plugin for SwayOSD on-screen display colour themes.
|
Package swayosd provides an output plugin for SwayOSD on-screen display colour themes. |
|
Package template provides utilities for loading plugin templates with custom override support.
|
Package template provides utilities for loading plugin templates with custom override support. |
|
Package walker provides an output plugin for Walker application launcher colour themes.
|
Package walker provides an output plugin for Walker application launcher colour themes. |
|
Package waybar provides an output plugin for Waybar status bar colour themes.
|
Package waybar provides an output plugin for Waybar status bar colour themes. |
|
Package wbg provides an output plugin for wbg, a simple Wayland wallpaper application.
|
Package wbg provides an output plugin for wbg, a simple Wayland wallpaper application. |
|
Package wofi provides an output plugin for Wofi application launcher colour themes.
|
Package wofi provides an output plugin for Wofi application launcher colour themes. |
|
Package zellij provides an output plugin for Zellij terminal multiplexer colour themes.
|
Package zellij provides an output plugin for Zellij terminal multiplexer colour themes. |