Documentation
¶
Overview ¶
Package common provides common functions used by all providers.
Index ¶
- Variables
- func CacheFile(file string) string
- func ClipboardText() string
- func ConfigDirs() []string
- func FileExists(filename string) bool
- func ForceTerminalForFile(file string) bool
- func FuzzyScore(input, target string, exact bool) (int32, []int32, int32)
- func GetLastMenuValue(L *lua.LState) int
- func GetTerminal() string
- func GitPush(provider, file string, w *git.Worktree, r *git.Repository)
- func InitRunPrefix()
- func JSONDecode(L *lua.LState) int
- func JSONEncode(L *lua.LState) int
- func LaunchPrefix(override string) string
- func LoadConfig(provider string, config any)
- func LoadGlobalConfig()
- func LoadMenus()
- func ProviderConfig(provider string) (string, error)
- func ReplaceResultOrStdinCmd(replace, result string) *exec.Cmd
- func SetExplicitDir(dir string)
- func SetupGit(provider string, cfg Gittable)
- func TmpDir() string
- func WrapWithTerminal(in string) string
- type Command
- type Config
- type ElephantConfig
- type Entry
- type Gittable
- type Menu
- type MenuConfig
- type PushData
- type Repo
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrConfigNotExists = errors.New("provider config doesn't exist")
Functions ¶
func ClipboardText ¶ added in v2.6.5
func ClipboardText() string
func ConfigDirs ¶ added in v2.1.3
func ConfigDirs() []string
func FileExists ¶
func ForceTerminalForFile ¶
func GetLastMenuValue ¶ added in v2.14.0
func GetTerminal ¶
func GetTerminal() string
func GitPush ¶ added in v2.14.0
func GitPush(provider, file string, w *git.Worktree, r *git.Repository)
TODO: this needs better commit messages somehow...
func InitRunPrefix ¶
func InitRunPrefix()
func JSONDecode ¶ added in v2.15.0
func JSONEncode ¶ added in v2.15.0
func LaunchPrefix ¶
func LoadConfig ¶
func LoadGlobalConfig ¶
func LoadGlobalConfig()
func ProviderConfig ¶
func ReplaceResultOrStdinCmd ¶
func SetExplicitDir ¶
func SetExplicitDir(dir string)
func WrapWithTerminal ¶
Types ¶
type Config ¶
type Config struct {
Icon string `koanf:"icon" desc:"icon for provider" default:"depends on provider"`
NamePretty string `koanf:"name_pretty" desc:"displayed name for the provider" default:"depends on provider"`
MinScore int32 `koanf:"min_score" desc:"minimum score for items to be displayed" default:"depends on provider"`
HideFromProviderlist bool `koanf:"hide_from_providerlist" desc:"hides a provider from the providerlist provider. provider provider." default:"false"`
}
type ElephantConfig ¶
type ElephantConfig struct {
AutoDetectLaunchPrefix bool `koanf:"auto_detect_launch_prefix" desc:"automatically detects uwsm, app2unit or systemd-run" default:"true"`
OverloadLocalEnv bool `koanf:"overload_local_env" desc:"overloads the local env" default:"false"`
IgnoredProviders []string `koanf:"ignored_providers" desc:"providers to ignore" default:"<empty>"`
GitOnDemand bool `koanf:"git_on_demand" desc:"sets up git repositories on first query instead of on start" default:"true"`
BeforeLoad []Command `koanf:"before_load" desc:"commands to run before starting to load the providers" default:""`
}
func GetElephantConfig ¶
func GetElephantConfig() *ElephantConfig
type Entry ¶
type Entry struct {
Text string `toml:"text" desc:"text for entry"`
Async string `toml:"async" desc:"if the text should be updated asynchronously based on the action"`
Subtext string `toml:"subtext" desc:"sub text for entry"`
Value string `toml:"value" desc:"value to be used for the action."`
Actions map[string]string `toml:"actions" desc:"actions items can use"`
Terminal bool `toml:"terminal" desc:"runs action in terminal if true"`
Icon string `toml:"icon" desc:"icon for entry"`
SubMenu string `toml:"submenu" desc:"submenu to open, if has prefix 'dmenu:' it'll launch that dmenu"`
Preview string `toml:"preview" desc:"filepath for the preview"`
PreviewType string `toml:"preview_type" desc:"type of the preview: text, file [default], command"`
Keywords []string `toml:"keywords" desc:"searchable keywords"`
State []string `toml:"state" desc:"state of an item, can be used to f.e. mark it as current"`
Identifier string `toml:"-"`
Menu string `toml:"-"`
}
func (Entry) CreateIdentifier ¶
type Menu ¶
type Menu struct {
HideFromProviderlist bool `toml:"hide_from_providerlist" desc:"hides a provider from the providerlist provider. provider provider." default:"false"`
Name string `toml:"name" desc:"name of the menu"`
NamePretty string `toml:"name_pretty" desc:"prettier name you usually want to display to the user."`
Description string `toml:"description" desc:"used as a subtext"`
Icon string `toml:"icon" desc:"default icon"`
Action string `toml:"action" desc:"default menu action to use"`
Actions map[string]string `toml:"actions" desc:"global actions"`
AsyncActions []string `toml:"async_actions" desc:"set which actions should update the item on the client asynchronously"`
SearchName bool `toml:"search_name" desc:"wether to search for the menu name as well when searching globally" default:"false"`
Cache bool `toml:"cache" desc:"will cache the results of the lua script on startup"`
RefreshOnChange []string `` /* 131-byte string literal not displayed */
Entries []Entry `toml:"entries" desc:"menu items"`
Terminal bool `toml:"terminal" desc:"execute action in terminal or not"`
Keywords []string `toml:"keywords" desc:"searchable keywords"`
FixedOrder bool `toml:"fixed_order" desc:"don't sort entries alphabetically"`
History bool `toml:"history" desc:"make use of history for sorting"`
HistoryWhenEmpty bool `toml:"history_when_empty" desc:"consider history when query is empty"`
MinScore int32 `toml:"min_score" desc:"minimum score for items to be displayed" default:"depends on provider"`
Parent string `toml:"parent" desc:"defines the parent menu" default:""`
SubMenu string `toml:"submenu" desc:"defines submenu to trigger on activation" default:""`
// internal
LuaString string
IsLua bool `toml:"-"`
}
func (*Menu) CreateLuaEntries ¶ added in v2.7.2
func (*Menu) NewLuaState ¶ added in v2.15.0
type MenuConfig ¶
type MenuConfig struct {
Config `koanf:",squash"`
Paths []string `koanf:"paths" desc:"additional paths to check for menu definitions." default:""`
}
var ( MenuConfigLoaded MenuConfig Menus = make(map[string]*Menu) )
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package history provides functions to save and load history in a streamlined way.
|
Package history provides functions to save and load history in a streamlined way. |
|
Package wlr implements the wlr_foreign_toplevel_management_unstable_v1 protocol
|
Package wlr implements the wlr_foreign_toplevel_management_unstable_v1 protocol |
Click to show internal directories.
Click to hide internal directories.