config

package
v0.6.8 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Themes embed.FS

Functions

This section is empty.

Types

type ActivationLabelWidget

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

type ActivationMode

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

type Anchors

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

type Applications

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

type Box

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

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"`
	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"`
	Websearch      Websearch      `mapstructure:"websearch"`
	Windows        Windows        `mapstructure:"windows"`
}

type Clipboard

type Clipboard struct {
	GeneralModule `mapstructure:",squash"`
	ImageHeight   int `mapstructure:"image_height"`
	MaxEntries    int `mapstructure:"max_entries"`
}

type Commands

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

type Config

type Config struct {
	ActivationMode ActivationMode `mapstructure:"activation_mode"`
	Builtins       Builtins       `mapstructure:"builtins"`
	Disabled       []string       `mapstructure:"disabled"`
	IgnoreMouse    bool           `mapstructure:"ignore_mouse"`
	List           List           `mapstructure:"list"`
	Plugins        []Plugin       `mapstructure:"plugins"`
	Search         Search         `mapstructure:"search"`
	Theme          string         `mapstructure:"theme"`
	ThemeBase      []string       `mapstructure:"theme_base"`
	Terminal       string         `mapstructure:"terminal"`

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

func Get

func Get(config string) *Config

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"`
}

type Finder

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

type GeneralModule

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

	// 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"`
}

type List

type List struct {
	Cycle              bool `mapstructure:"cycle"`
	MaxEntries         int  `mapstructure:"max_entries"`
	ShowInitialEntries bool `mapstructure:"show_initial_entries"`
	SingleClick        bool `mapstructure:"single_click"`
}

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 {
	Widget      `mapstructure:",squash"`
	Item        ListItemWidget `mapstructure:"item"`
	Grid        bool           `mapstructure:"grid"`
	Orientation string         `mapstructure:"orientation"`
	MinHeight   int            `mapstructure:"min_height"`
	MaxHeight   int            `mapstructure:"max_height"`
	MaxWidth    int            `mapstructure:"max_width"`
	MinWidth    int            `mapstructure:"min_width"`
	AlwaysShow  bool           `mapstructure:"always_show"`
}

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"`
	Matching       util.MatchingType `mapstructure:"matching"`
	Src            string            `mapstructure:"src"`
	SrcOnce        string            `mapstructure:"src_once"`
	SrcOnceRefresh bool              `mapstructure:"src_once_refresh"`
	Entries        []util.Entry      `mapstructure:"entries"`
	Terminal       bool              `mapstructure:"terminal"`
}

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"`
}

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 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"`
	Engines       []string `mapstructure:"engines"`
}

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