config

package
v0.10.12 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Themes embed.FS

Functions

This section is empty.

Types

type AI added in v0.9.0

type AI struct {
	GeneralModule `mapstructure:",squash"`
	Anthropic     Anthropic `mapstructure:"anthropic"`
}

type ActivationLabelWidget

type ActivationLabelWidget struct {
	LabelWidget  `mapstructure:",squash"`
	Overlay      bool `mapstructure:"overlay"`
	HideModifier bool `mapstructure:"hide_modifier"`
}

type ActivationMode

type ActivationMode struct {
	Disabled bool   `mapstructure:"disabled"`
	Labels   string `mapstructure:"labels"`
	UseAlt   bool   `mapstructure:"use_alt"`
	UseFKeys bool   `mapstructure:"use_f_keys"`
}

type AiListWrapper added in v0.9.2

type AiListWrapper struct {
	BoxWidget `mapstructure:",squash"`
	Item      LabelWidget `mapstructure:"item"`
}

type AiScroll added in v0.9.0

type AiScroll struct {
	Widget           `mapstructure:",squash"`
	List             AiListWrapper `mapstructure:"list"`
	OverlayScrolling bool          `mapstructure:"overlay_scrolling"`
	HScrollbarPolicy string        `mapstructure:"h_scrollbar_policy"`
	VScrollbarPolicy string        `mapstructure:"v_scrollbar_policy"`
}

type Anchors

type Anchors struct {
	Bottom bool `mapstructure:"bottom"`
	Left   bool `mapstructure:"left"`
	Right  bool `mapstructure:"right"`
	Top    bool `mapstructure:"top"`
}

type Anthropic added in v0.9.0

type Anthropic struct {
	Prompts []AnthropicPrompt `mapstructure:"prompts"`
}

type AnthropicPrompt added in v0.9.10

type AnthropicPrompt struct {
	Model            string  `mapstructure:"model"`
	MaxTokens        int     `mapstructure:"max_tokens"`
	Temperature      float64 `mapstructure:"temperature"`
	Label            string  `mapstructure:"label"`
	Prompt           string  `mapstructure:"prompt"`
	SingleModuleOnly bool    `mapstructure:"single_module_only"`
}

type ApplicationActions added in v0.9.10

type ApplicationActions struct {
	Enabled          bool `mapstructure:"enabled"`
	HideCategory     bool `mapstructure:"hide_category"`
	HideWithoutQuery bool `mapstructure:"hide_without_query"`
}

type Applications

type Applications struct {
	GeneralModule `mapstructure:",squash"`
	Actions       ApplicationActions `mapstructure:"actions"`
	Cache         bool               `mapstructure:"cache"`
	ContextAware  bool               `mapstructure:"context_aware"`
	PrioritizeNew bool               `mapstructure:"prioritize_new"`
	ShowGeneric   bool               `mapstructure:"show_generic"`
}

type Bar added in v0.8.0

type Bar struct {
	Entries []BarEntry `mapstructure:"entries"`
}

type BarEntry added in v0.8.0

type BarEntry struct {
	Exec   string `mapstructure:"exec"`
	Icon   string `mapstructure:"icon"`
	Label  string `mapstructure:"label"`
	Module string `mapstructure:"module"`
}

type BarEntryWrapper added in v0.8.0

type BarEntryWrapper struct {
	BoxWidget `mapstructure:",squash"`
	Icon      ImageWidget `mapstructure:"icon"`
	Label     LabelWidget `mapstructure:"label"`
}

type BarWrapper added in v0.8.0

type BarWrapper struct {
	BoxWidget `mapstructure:",squash"`
	Position  string          `mapstructure:"position"`
	Entry     BarEntryWrapper `mapstructure:"entry"`
}

type Blacklist added in v0.10.4

type Blacklist struct {
	Regexp string `mapstructure:"regexp"`
	Label  bool   `mapstructure:"label"`
	Sub    bool   `mapstructure:"sub"`

	// internal
	Reg *regexp.Regexp `mapstructure:"-"`
}

type BookmarkEntry added in v0.10.0

type BookmarkEntry struct {
	Label    string   `mapstructure:"label"`
	Url      string   `mapstructure:"url"`
	Keywords []string `mapstructure:"keywords"`
}

type BookmarkGroup added in v0.10.1

type BookmarkGroup struct {
	Label            string          `mapstructure:"label"`
	Prefix           string          `mapstructure:"prefix"`
	IgnoreUnprefixed bool            `mapstructure:"ignore_unprefixed"`
	Entries          []BookmarkEntry `mapstructure:"entries"`
}

type Bookmarks added in v0.10.0

type Bookmarks struct {
	GeneralModule `mapstructure:",squash"`
	Groups        []BookmarkGroup `mapstructure:"groups"`
	Entries       []BookmarkEntry `mapstructure:"entries"`
}

type Box

type Box struct {
	BoxWidget `mapstructure:",squash"`
	Scroll    Scroll        `mapstructure:"scroll"`
	AiScroll  AiScroll      `mapstructure:"ai_scroll"`
	Revert    bool          `mapstructure:"revert"`
	Search    SearchWrapper `mapstructure:"search"`
	Bar       BarWrapper    `mapstructure:"bar"`
}

type BoxWidget

type BoxWidget struct {
	Widget      `mapstructure:",squash"`
	Orientation string `mapstructure:"orientation"`
	Spacing     int    `mapstructure:"spacing"`
}

type Builtins

type Builtins struct {
	Applications   Applications   `mapstructure:"applications"`
	AI             AI             `mapstructure:"ai"`
	Bookmarks      Bookmarks      `mapstructure:"bookmarks"`
	Calc           Calc           `mapstructure:"calc"`
	Clipboard      Clipboard      `mapstructure:"clipboard"`
	Commands       Commands       `mapstructure:"commands"`
	CustomCommands CustomCommands `mapstructure:"custom_commands"`
	Dmenu          Dmenu          `mapstructure:"dmenu"`
	Emojis         Emojis         `mapstructure:"emojis"`
	Finder         Finder         `mapstructure:"finder"`
	Runner         Runner         `mapstructure:"runner"`
	SSH            SSH            `mapstructure:"ssh"`
	Switcher       Switcher       `mapstructure:"switcher"`
	Symbols        Symbols        `mapstructure:"symbols"`
	Websearch      Websearch      `mapstructure:"websearch"`
	Windows        Windows        `mapstructure:"windows"`
}

type Calc added in v0.7.0

type Calc struct {
	GeneralModule `mapstructure:",squash"`
	RequireNumber bool `mapstructure:"require_number"`
}

type Clipboard

type Clipboard struct {
	GeneralModule   `mapstructure:",squash"`
	AvoidLineBreaks bool   `mapstructure:"avoid_line_breaks"`
	ImageHeight     int    `mapstructure:"image_height"`
	MaxEntries      int    `mapstructure:"max_entries"`
	Exec            string `mapstructure:"exec"`
}

type Commands

type Commands struct {
	GeneralModule `mapstructure:",squash"`
}

type Config

type Config struct {
	ActivationMode      ActivationMode `mapstructure:"activation_mode"`
	AsWindow            bool           `mapstructure:"as_window"`
	Bar                 Bar            `mapstructure:"bar"`
	Builtins            Builtins       `mapstructure:"builtins"`
	DisableClickToClose bool           `mapstructure:"disable_click_to_close"`
	Disabled            []string       `mapstructure:"disabled"`
	Events              Events         `mapstructure:"events"`
	ForceKeyboardFocus  bool           `mapstructure:"force_keyboard_focus"`
	HotreloadTheme      bool           `mapstructure:"hotreload_theme"`
	IgnoreMouse         bool           `mapstructure:"ignore_mouse"`
	List                List           `mapstructure:"list"`
	Monitor             string         `mapstructure:"monitor"`
	Plugins             []Plugin       `mapstructure:"plugins"`
	Search              Search         `mapstructure:"search"`
	Terminal            string         `mapstructure:"terminal"`
	Theme               string         `mapstructure:"theme"`
	ThemeBase           []string       `mapstructure:"theme_base"`
	Timeout             int            `mapstructure:"timeout"`
	UseUWSM             bool           `mapstructure:"use_uwsm"`

	Available []string `mapstructure:"-"`
	IsService bool     `mapstructure:"-"`
}

func Get

func Get(config string) (*Config, error)

type CustomCommand

type CustomCommand struct {
	Cmd      string `mapstructure:"cmd"`
	CmdAlt   string `mapstructure:"cmd_alt"`
	Name     string `mapstructure:"name"`
	Terminal bool   `mapstructure:"terminal"`
}

type CustomCommands

type CustomCommands struct {
	GeneralModule `mapstructure:",squash"`
	Commands      []CustomCommand `mapstructure:"commands"`
}

type Dmenu

type Dmenu struct {
	GeneralModule `mapstructure:",squash"`
	Separator     string `mapstructure:"separator"`
	LabelColumn   int    `mapstructure:"label_column"`
}

type Emojis

type Emojis struct {
	GeneralModule   `mapstructure:",squash"`
	Exec            string `mapstructure:"exec"`
	ExecAlt         string `mapstructure:"exec_alt"`
	ShowUnqualified bool   `mapstructure:"show_unqualified"`
}

type EventType added in v0.10.12

type EventType int
const (
	EventLaunch EventType = iota
	EventSelection
	EventExit
	EventActivate
	EventQueryChange
)

type Events added in v0.10.12

type Events struct {
	OnLaunch      string `mapstructure:"on_launch"`
	OnSelection   string `mapstructure:"on_selection"`
	OnExit        string `mapstructure:"on_exit"`
	OnActivate    string `mapstructure:"on_activate"`
	OnQueryChange string `mapstructure:"on_query_change"`
}

type Finder

type Finder struct {
	GeneralModule   `mapstructure:",squash"`
	UseFD           bool `mapstructure:"use_fd"`
	IgnoreGitIgnore bool `mapstructure:"ignore_gitignore"`
	Concurrency     int  `mapstructure:"concurrency"`
	EagerLoading    bool `mapstructure:"eager_loading"`
}

type GeneralModule

type GeneralModule struct {
	AutoSelect         bool        `mapstructure:"auto_select"`
	Blacklist          []Blacklist `mapstructure:"blacklist"`
	Delay              int         `mapstructure:"delay"`
	History            bool        `mapstructure:"history"`
	Icon               string      `mapstructure:"icon"`
	KeepSort           bool        `mapstructure:"keep_sort"`
	MinChars           int         `mapstructure:"min_chars"`
	Name               string      `mapstructure:"name"`
	Placeholder        string      `mapstructure:"placeholder"`
	Prefix             string      `mapstructure:"prefix"`
	Refresh            bool        `mapstructure:"refresh"`
	ShowIconWhenSingle bool        `mapstructure:"show_icon_when_single"`
	ShowSubWhenSingle  bool        `mapstructure:"show_sub_when_single"`
	SwitcherOnly       bool        `mapstructure:"switcher_only"`
	Theme              string      `mapstructure:"theme"`
	ThemeBase          []string    `mapstructure:"theme_base"`
	Typeahead          bool        `mapstructure:"typeahead"`
	Weight             int         `mapstructure:"weight"`

	// internal
	HasInitialSetup bool `mapstructure:"-"`
	IsSetup         bool `mapstructure:"-"`
}

type ImageWidget

type ImageWidget struct {
	Widget    `mapstructure:",squash"`
	IconSize  string `mapstructure:"icon_size"`
	PixelSize int    `mapstructure:"pixel_size"`
	Theme     string `mapstructure:"theme"`
}

type LabelWidget

type LabelWidget struct {
	Widget  `mapstructure:",squash"`
	Justify string  `mapstructure:"justify"`
	XAlign  float32 `mapstructure:"x_align"`
	YAlign  float32 `mapstructure:"y_align"`
	Wrap    bool    `mapstructure:"wrap"`
}

type List

type List struct {
	Cycle               bool   `mapstructure:"cycle"`
	KeyboardScrollStyle string `mapstructure:"keyboard_scroll_style"`
	MaxEntries          int    `mapstructure:"max_entries"`
	Placeholder         string `mapstructure:"placeholder"`
	ShowInitialEntries  bool   `mapstructure:"show_initial_entries"`
	SingleClick         bool   `mapstructure:"single_click"`
	VisibilityThreshold int    `mapstructure:"visibility_threshold"`
}

type ListItemWidget

type ListItemWidget struct {
	BoxWidget       `mapstructure:",squash"`
	Revert          bool                  `mapstructure:"revert"`
	ActivationLabel ActivationLabelWidget `mapstructure:"activation_label"`
	Icon            ImageWidget           `mapstructure:"icon"`
	Text            TextWrapper           `mapstructure:"text"`
}

type ListWrapper

type ListWrapper struct {
	AlwaysShow  bool           `mapstructure:"always_show"`
	Grid        bool           `mapstructure:"grid"`
	Item        ListItemWidget `mapstructure:"item"`
	MaxHeight   int            `mapstructure:"max_height"`
	MaxWidth    int            `mapstructure:"max_width"`
	MinHeight   int            `mapstructure:"min_height"`
	MinWidth    int            `mapstructure:"min_width"`
	Orientation string         `mapstructure:"orientation"`
	Placeholder LabelWidget    `mapstructure:"placeholder"`
	Widget      `mapstructure:",squash"`
}

type Margins

type Margins struct {
	Bottom int `mapstructure:"bottom"`
	End    int `mapstructure:"end"`
	Start  int `mapstructure:"start"`
	Top    int `mapstructure:"top"`
}

type Plugin

type Plugin struct {
	GeneralModule    `mapstructure:",squash"`
	Cmd              string            `mapstructure:"cmd"`
	CmdAlt           string            `mapstructure:"cmd_alt"`
	Entries          []util.Entry      `mapstructure:"entries"`
	LabelColumn      int               `mapstructure:"label_column"`
	Matching         util.MatchingType `mapstructure:"matching"`
	RecalculateScore bool              `mapstructure:"recalculate_score,omitempty" json:"recalculate_score,omitempty"`
	ResultColumn     int               `mapstructure:"result_column"`
	Separator        string            `mapstructure:"separator"`
	Src              string            `mapstructure:"src"`
	SrcOnce          string            `mapstructure:"src_once"`
	Terminal         bool              `mapstructure:"terminal"`
	Parser           string            `mapstructure:"parser"`
	KvSeparator      string            `mapstructure:"kv_separator"`
	Output           bool              `mapstructure:"output"`
	Keywords         []string          `mapstructure:"keywords"`
}

type PromptWidget

type PromptWidget struct {
	LabelWidget `mapstructure:",squash"`
	Text        string `mapstructure:"text"`
}

type Runner

type Runner struct {
	GeneralModule `mapstructure:",squash"`
	Excludes      []string `mapstructure:"excludes"`
	Includes      []string `mapstructure:"includes"`
	ShellConfig   string   `mapstructure:"shell_config"`
	GenericEntry  bool     `mapstructure:"generic_entry"`
}

type SSH

type SSH struct {
	GeneralModule `mapstructure:",squash"`
	ConfigFile    string `mapstructure:"config_file"`
	HostFile      string `mapstructure:"host_file"`
}

type Scroll

type Scroll struct {
	Widget           `mapstructure:",squash"`
	List             ListWrapper `mapstructure:"list"`
	OverlayScrolling bool        `mapstructure:"overlay_scrolling"`
	HScrollbarPolicy string      `mapstructure:"h_scrollbar_policy"`
	VScrollbarPolicy string      `mapstructure:"v_scrollbar_policy"`
}
type Search struct {
	Delay           int    `mapstructure:"delay"`
	Placeholder     string `mapstructure:"placeholder"`
	ResumeLastQuery bool   `mapstructure:"resume_last_query"`
}

type SearchWidget

type SearchWidget struct {
	Widget `mapstructure:",squash"`
	Icons  bool `mapstructure:"icons"`
}

type SearchWrapper

type SearchWrapper struct {
	BoxWidget `mapstructure:",squash"`
	Revert    bool          `mapstructure:"revert"`
	Input     SearchWidget  `mapstructure:"input"`
	Prompt    PromptWidget  `mapstructure:"prompt"`
	Spinner   SpinnerWidget `mapstructure:"spinner"`
}

type SpinnerWidget

type SpinnerWidget struct {
	Widget `mapstructure:",squash"`
}

type Switcher

type Switcher struct {
	GeneralModule `mapstructure:",squash"`
}

type Symbols added in v0.9.8

type Symbols struct {
	GeneralModule `mapstructure:",squash"`
	AfterCopy     string `mapstructure:"after_copy"`
}

type TextWrapper

type TextWrapper struct {
	BoxWidget `mapstructure:",squash"`
	Label     LabelWidget `mapstructure:"label"`
	Revert    bool        `mapstructure:"revert"`
	Sub       LabelWidget `mapstructure:"sub"`
}

type UI

type UI struct {
	Anchors         Anchors `mapstructure:"anchors"`
	Fullscreen      bool    `mapstructure:"fullscreen"`
	IgnoreExclusive bool    `mapstructure:"ignore_exclusive"`
	Window          Window  `mapstructure:"window"`

	// internal
	AlignMap        map[string]gtk.Align         `mapstructure:"-"`
	IconSizeMap     map[string]gtk.IconSize      `mapstructure:"-"`
	IconSizeIntMap  map[string]int               `mapstructure:"-"`
	JustifyMap      map[string]gtk.Justification `mapstructure:"-"`
	OrientationMap  map[string]gtk.Orientation   `mapstructure:"-"`
	ScrollPolicyMap map[string]gtk.PolicyType    `mapstructure:"-"`
}

func GetLayout

func GetLayout(theme string, base []string) *UI

func (*UI) InitUnitMaps

func (u *UI) InitUnitMaps()

type UICfg

type UICfg struct {
	UI UI `mapstructure:"ui"`
}

type Websearch

type Websearch struct {
	GeneralModule `mapstructure:",squash"`
	Entries       []WebsearchEntry `mapstructure:"entries"`
}

type WebsearchEntry added in v0.9.7

type WebsearchEntry struct {
	Name         string `mapstructure:"name"`
	Url          string `mapstructure:"url"`
	Prefix       string `mapstructure:"prefix"`
	SwitcherOnly bool   `mapstructure:"switcher_only"`
}

type Widget

type Widget struct {
	CssClasses []string `mapstructure:"css_classes"`
	HAlign     string   `mapstructure:"h_align"`
	HExpand    bool     `mapstructure:"h_expand"`
	Height     int      `mapstructure:"height"`
	Hide       bool     `mapstructure:"hide"`
	Margins    Margins  `mapstructure:"margins"`
	Name       string   `mapstructure:"name"`
	Opacity    float64  `mapstructure:"opacity"`
	VAlign     string   `mapstructure:"v_align"`
	VExpand    bool     `mapstructure:"h_expand"`
	Width      int      `mapstructure:"width"`
}

type Window

type Window struct {
	Widget `mapstructure:",squash"`
	Box    Box `mapstructure:"box"`
}

type Windows

type Windows struct {
	GeneralModule `mapstructure:",squash"`
}

Jump to

Keyboard shortcuts

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