apprunner

package
v0.0.0-...-df464e1 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPrograms

func GetPrograms() ([]bolt.Searchable, error)

func RunProgram

func RunProgram(choice bolt.Searchable) error

func Scan

func Scan(dirs []string) ([][]*Entry, error)

Scan non-recursively scans provided directories for desktop entry files and parses them. A slice of parsed entries is returned for each directory.

Types

type Entry

type Entry struct {
	// Type is the type of the entry. It may be Application, Link or Directory.
	Type EntryType

	// Name is the name of the entry.
	Name string

	// GenericName is a generic description of the entry.
	GenericName string

	// Comment is extra information about the entry.
	Comment string

	// Icon is the path to an icon file or name of a themed icon.
	Icon string

	// Path is the directory to start in.
	Path string

	// Exec is the command(s) to be executed when launched.
	Exec string

	// URL is the URL to be visited when launched.
	URL string

	// Terminal controls whether to run in a terminal.
	Terminal bool
}

Entry represents a parsed desktop entry.

func Parse

func Parse(content io.Reader, buf []byte) (*Entry, error)

Parse reads and parses a .desktop file into an *Entry.

func (*Entry) ExpandExec

func (e *Entry) ExpandExec(args string) string

ExpandExec fills keywords in the provided entry's Exec with user arguments.

func (*Entry) ToSlice

func (e *Entry) ToSlice() []string

type EntryType

type EntryType int

EntryType may be Application, Link or Directory.

const (
	Unknown     EntryType = iota // Unspecified or unrecognized
	Application                  // Execute command
	Link                         // Open browser
	Directory                    // Open file manager
)

All entry types

func (EntryType) String

func (t EntryType) String() string

type ProgramItem

type ProgramItem struct {
	Name        string
	Description string
	Exec        []string
}

func (*ProgramItem) ToSlice

func (pi *ProgramItem) ToSlice() []string

Jump to

Keyboard shortcuts

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