gmenu

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const VersionInfo = `` /* 165-byte string literal not displayed */

VersionInfo is the text printed when the --version flag is supplied.

Variables

View Source
var (
	// Entries is a slice of all desktop entries.
	Entries []*desktop.Entry
	// Names is a slice of all desktop entry names.
	Names []string

	// FilteredEntries is a slice of filtered desktop entries.
	FilteredEntries []*ListEntry
)
View Source
var Version = "0.0.0"

Version is the version of the application.

Functions

func CloseInput

func CloseInput()

CloseInput closes the input buffer.

func DesktopEntries

func DesktopEntries(c *Config) ([]*desktop.Entry, []string, error)

DesktopEntries scans for desktop entries.

func FilterEntries

func FilterEntries()

FilterEntries sets FilteredEntries to all entries matching the input buffer.

func HandleInput

func HandleInput(u InputUpdateHandler)

HandleInput is a goroutine which reads changes in the input buffer and calls the supplied InputUpdateHandler.

func LoadEntries

func LoadEntries(c *Config)

LoadEntries scans for and loads desktop entries.

func MatchEntry

func MatchEntry(i int) bool

MatchEntry returns whether the entry at the supplied index matches the input buffer.

func Run

func Run(config *Config, execute string, path string, runInTerminal bool, waitUntilFinished bool) error

Run executes the specified command.

func SetInput

func SetInput(i string)

SetInput sets the input buffer.

func SharedInit

func SharedInit(c *Config)

SharedInit performs any necessary initialization shared between gmenu and gtkmenu.

func Sort

func Sort(i, j int) bool

Sort returns whether entry i should be sorted before entry j.

func SortEmpty

func SortEmpty(i, j int) bool

SortEmpty returns whether entry i should be sorted before entry j when the input buffer is blank.

func SortFiltered

func SortFiltered(i, j int) bool

SortFiltered returns whether entry i should be sorted before entry j when the input buffer is not blank.

Types

type Config

type Config struct {
	PrintVersion bool

	DataDirs string

	HideGenericNames bool
	HideAppDetails   bool
	// contains filtered or unexported fields
}

Config stores configuration variables.

func (*Config) BrowserCommand

func (c *Config) BrowserCommand() string

BrowserCommand returns the command to execute to open a browser.

func (*Config) TerminalCommand

func (c *Config) TerminalCommand() string

TerminalCommand returns the command to execute to open a terminal.

type InputUpdateHandler

type InputUpdateHandler func(input string)

InputUpdateHandler is a handler to be executed when the input is updated.

type ListEntry

type ListEntry struct {
	*desktop.Entry

	Label string
}

ListEntry is a desktop entry and its label.

Jump to

Keyboard shortcuts

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