desktop

package
v0.0.0-...-b346baa Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrHiddenEntry  = errors.New("hidden entry")
	ErrInvalidEntry = errors.New("invalid entry")
)

Functions

func Flatten

func Flatten(entries []*Entry) [][]string

Flatten given slice of entries, return two slices of strings containing applications names, and executables. It's needed for fuzzy searching, this will become "index".

func Sort

func Sort(entries []*Entry, descending bool)

Sort returns slice of entries sorted by name in order

func TrimRight

func TrimRight(cmd string) string

TrimRight returns string without placeholders for addittional arguments

Types

type Entry

type Entry struct {
	Exec string
	Name string
	Term bool
	Type string
	URL  string
}

Entry struct for fields from file.desktop

func NewEntry

func NewEntry(fn, lang string) (*Entry, error)

NewEntry returns new entry with parsed fields from given file. returns errInvalid

Jump to

Keyboard shortcuts

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