config

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommandsAsStringSlice

func CommandsAsStringSlice(commands []Command) []string

func SaveConfig

func SaveConfig(config Config)

Types

type App

type App struct {
	// Name of the window
	Name string `yaml:"name"`

	// Commands that should be executed in the window
	Commands []Command `yaml:"commands,omitempty"`

	// Default indicates if this window should be selected by default
	Default bool `yaml:"default,omitempty"`

	// Rules is a list of rules, at least one must match for the window to be created
	Rules []string `yaml:"rules,omitempty"`

	// GUI indicates that this app is a GUI application (will not be started in a terminal)
	GUI bool `yaml:"gui,omitempty"`

	// Group a app belongs to, only the first matching option within a group will be used
	Group string `yaml:"group,omitempty"`
}

type Command

type Command struct {
	// Command that should be executed
	Command string `yaml:"command"`

	// Rules is a list of rules, at least one must match for the window to be created
	Rules []string `yaml:"rules,omitempty"`
}

type Config

type Config struct {
	// Modules is a list of recon modules
	Modules []ModuleConfig `yaml:"-"`

	// Layouts is a map of tmux layouts
	Layouts map[string]Layout `yaml:"layouts"`

	// Finder
	Finder *FinderConfig `yaml:"finder"`
}

func LoadConfig

func LoadConfig() (Config, error)

func MergeConfig

func MergeConfig(a Config, b Config) Config

func ResolvedConfig

func ResolvedConfig() (Config, error)

func (*Config) UnmarshalYAML added in v0.8.0

func (c *Config) UnmarshalYAML(value *yaml.Node) error

type FinderConfig

type FinderConfig struct {
	// Executable is the fuzzy finder, e.g. "fzf" or "embedded"
	Executable string `yaml:"executable"`

	// Preview indicates if the preview should be shown
	Preview bool `yaml:"preview"`

	// FZFPreview can be used to overwrite the option delimiter
	FZFDelimiter string `yaml:"fzf-delimiter"`
}

type Layout

type Layout struct {
	// Apps contains the list of apps that should be started
	Apps []App `yaml:"apps"`

	// Rules is a list of rules, at least one must match for this layout to be selected
	Rules []string `yaml:"rules,omitempty"`

	// ClearWorkspace indicates if the workspace should be cleared before starting the applications (only applies to window managers, default: false)
	ClearWorkspace bool `yaml:"clear-workspace,omitempty"`
}

type ModuleConfig added in v0.8.0

type ModuleConfig interface{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL