desktopappinfo

package
v0.0.0-...-51dca1d Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: GPL-3.0 Imports: 17 Imported by: 11

Documentation

Index

Constants

View Source
const (
	MainSection        = "Desktop Entry"
	KeyType            = "Type"
	KeyVersion         = "Version"
	KeyName            = "Name"
	KeyGenericName     = "GenericName"
	KeyNoDisplay       = "NoDisplay"
	KeyComment         = "Comment"
	KeyIcon            = "Icon"
	KeyHidden          = "Hidden"
	KeyOnlyShowIn      = "OnlyShowIn"
	KeyNotShowIn       = "NotShowIn"
	KeyTryExec         = "TryExec"
	KeyExec            = "Exec"
	KeyPath            = "Path"
	KeyTerminal        = "Terminal"
	KeyMimeType        = "MimeType"
	KeyCategories      = "Categories"
	KeyKeywords        = "Keywords"
	KeyStartupNotify   = "StartupNotify"
	KeyStartupWMClass  = "StartupWMClass"
	KeyURL             = "URL"
	KeyActions         = "Actions"
	KeyDBusActivatable = "DBusActivatable"

	TypeApplication = "Application"
	TypeLink        = "Link"
	TypeDirectory   = "Directory"
)

Variables

View Source
var ErrBadFieldCode = errors.New("bad field code")
View Source
var ErrEscapeCharAtEnd = errors.New("escape char \\ at end of string")
View Source
var ErrInvalidFileExt = errors.New("the file extension is not " + desktopExt)
View Source
var ErrInvalidFirstSection = errors.New("first section is not " + MainSection)
View Source
var ErrInvalidType = errors.New("type is not " + TypeApplication)
View Source
var ErrNoSpaceAfterQuoting = errors.New("no space character found after a quoting")
View Source
var ErrQuotingNotClosed = errors.New("quoting is not be closed")

Functions

func GetDBusObjectFromAppDesktop

func GetDBusObjectFromAppDesktop(desktop string, service string, path string) (dbus.ObjectPath, error)

func SetDataDirs

func SetDataDirs(dirs []string)

func Walk

func Walk(root string, walkFn WalkFunc)

Types

type AppsDir

type AppsDir struct {
	Path     string
	AppNames map[string]int
}

type DesktopAction

type DesktopAction struct {
	Section string
	Name    string
	Exec    string
	// contains filtered or unexported fields
}

func (*DesktopAction) Launch

func (action *DesktopAction) Launch(files []string, launchContext *appinfo.AppLaunchContext) error

func (*DesktopAction) StartCommand

func (action *DesktopAction) StartCommand(files []string, launchContext *appinfo.AppLaunchContext) (*exec.Cmd, error)

type DesktopAppInfo

type DesktopAppInfo struct {
	*keyfile.KeyFile
	// contains filtered or unexported fields
}

func GetAll

func GetAll(skipDirs map[string][]string) []*DesktopAppInfo

func NewDesktopAppInfo

func NewDesktopAppInfo(id string) *DesktopAppInfo

func NewDesktopAppInfoFromFile

func NewDesktopAppInfoFromFile(filename string) (*DesktopAppInfo, error)

func NewDesktopAppInfoFromKeyFile

func NewDesktopAppInfoFromKeyFile(kfile *keyfile.KeyFile) (*DesktopAppInfo, error)

func (*DesktopAppInfo) GetActions

func (ai *DesktopAppInfo) GetActions() []DesktopAction

func (*DesktopAppInfo) GetCategories

func (ai *DesktopAppInfo) GetCategories() []string

func (*DesktopAppInfo) GetCommandline

func (ai *DesktopAppInfo) GetCommandline() string

func (*DesktopAppInfo) GetComment

func (ai *DesktopAppInfo) GetComment() string

func (*DesktopAppInfo) GetDBusActivatable

func (ai *DesktopAppInfo) GetDBusActivatable() bool

DBusActivatable is a boolean value specifying if D-Bus activation is supported for this application

func (*DesktopAppInfo) GetDesktopOverrideExec

func (ai *DesktopAppInfo) GetDesktopOverrideExec() string

func (*DesktopAppInfo) GetDisplayName

func (ai *DesktopAppInfo) GetDisplayName() string

func (*DesktopAppInfo) GetExecutable

func (ai *DesktopAppInfo) GetExecutable() string

func (*DesktopAppInfo) GetFileName

func (ai *DesktopAppInfo) GetFileName() string

func (*DesktopAppInfo) GetGenericName

func (ai *DesktopAppInfo) GetGenericName() string

func (*DesktopAppInfo) GetIcon

func (ai *DesktopAppInfo) GetIcon() string

func (*DesktopAppInfo) GetId

func (ai *DesktopAppInfo) GetId() string

func (*DesktopAppInfo) GetIsHidden

func (ai *DesktopAppInfo) GetIsHidden() bool

func (*DesktopAppInfo) GetIsHiden

func (ai *DesktopAppInfo) GetIsHiden() bool

deprecated

func (*DesktopAppInfo) GetKeywords

func (ai *DesktopAppInfo) GetKeywords() []string

func (*DesktopAppInfo) GetMimeTypes

func (ai *DesktopAppInfo) GetMimeTypes() []string

func (*DesktopAppInfo) GetName

func (ai *DesktopAppInfo) GetName() string

func (*DesktopAppInfo) GetNoDisplay

func (ai *DesktopAppInfo) GetNoDisplay() bool

func (*DesktopAppInfo) GetPath

func (ai *DesktopAppInfo) GetPath() string

func (*DesktopAppInfo) GetShowIn

func (ai *DesktopAppInfo) GetShowIn(desktopEnvs []string) bool

func (*DesktopAppInfo) GetStartupNotify

func (ai *DesktopAppInfo) GetStartupNotify() bool

func (*DesktopAppInfo) GetStartupWMClass

func (ai *DesktopAppInfo) GetStartupWMClass() string

func (*DesktopAppInfo) GetTerminal

func (ai *DesktopAppInfo) GetTerminal() bool

func (*DesktopAppInfo) GetTryExec

func (ai *DesktopAppInfo) GetTryExec() string

TryExec is Path to an executable file on disk used to determine if the program is actually installed

func (*DesktopAppInfo) IsDesktopOverrideExecSet

func (ai *DesktopAppInfo) IsDesktopOverrideExecSet() bool

func (*DesktopAppInfo) IsExecutableOk

func (ai *DesktopAppInfo) IsExecutableOk() bool

func (*DesktopAppInfo) IsInstalled

func (ai *DesktopAppInfo) IsInstalled() bool

func (*DesktopAppInfo) Launch

func (ai *DesktopAppInfo) Launch(files []string, launchContext *appinfo.AppLaunchContext) error

func (*DesktopAppInfo) SetDesktopOverrideExec

func (ai *DesktopAppInfo) SetDesktopOverrideExec(exec string)

func (*DesktopAppInfo) ShouldShow

func (ai *DesktopAppInfo) ShouldShow() bool

func (*DesktopAppInfo) StartCommand

func (ai *DesktopAppInfo) StartCommand(files []string, launchContext *appinfo.AppLaunchContext) (*exec.Cmd, error)

type ErrCharNotEscaped

type ErrCharNotEscaped struct {
	Char byte
}

func (ErrCharNotEscaped) Error

func (err ErrCharNotEscaped) Error() string

type ErrInvalidEscapeSequence

type ErrInvalidEscapeSequence struct {
	Char byte
}

func (ErrInvalidEscapeSequence) Error

func (err ErrInvalidEscapeSequence) Error() string

type ErrReservedCharNotQuoted

type ErrReservedCharNotQuoted struct {
	Char byte
}

func (ErrReservedCharNotQuoted) Error

func (err ErrReservedCharNotQuoted) Error() string

type WalkFunc

type WalkFunc func(name string, info os.FileInfo) bool

Jump to

Keyboard shortcuts

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