Documentation
¶
Overview ¶
Package desktop implements the Desktop Entry Spec. For more information, please see the spec: http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrMissingType means that the desktop entry is missing the // Type key, which is always required. ErrMissingType = errors.New("missing entry type") // ErrMissingName means that the desktop entry is missing the // Name key, which is required by the types Application, Link, // and Directory. ErrMissingName = errors.New("missing entry name") // ErrMissingURL means that the desktop entry is missing the URL // key, which is required by the type Link. ErrMissingURL = errors.New("missing entry url") )
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct {
// The type of desktop entry. It can be: Application, Link, or
// Directory.
Type Type
// The version of spec that the file conforms to.
Version string
// The real name of the desktop entry.
Name string
// A generic name, for example: Text Editor or Web Browser.
GenericName string
// A short comment that describes the desktop entry.
Comment string
// The name of an icon that should be used for this desktop
// entry. If it is not an absolute path, it should be searched
// for using the Icon Theme Specification.
Icon string
// The URL for a Link type entry.
URL string
// Whether or not to display the file in menus.
NoDisplay bool
// Whether the use has deleted the desktop entry.
Hidden bool
// A list of desktop environments that the desktop entry should
// only be shown in.
OnlyShowIn []string
// A list of desktop environments that the desktop entry should
// not be shown in.
NotShowIn []string
// Whether DBus Activation is supported by this application.
DBusActivatable bool
// The path to an executable to test if the program is
// installed.
TryExec string
// Program to execute.
Exec string
// The path that should be the programs working directory.
Path string
// Whether the program should be run in a terminal window.
Terminal bool
// A slice of actions.
Actions []*Action
// A slice of mimetypes supported by this program.
MimeType []string
// A slice of categories that the desktop entry should be shown
// in in a menu.
Categories []string
// A slice of interfaces that this application implements.
Implements []string
// A slice of keywords.
Keywords []string
// Whether the program will send a "remove" message when started
// with the DESKTOP_STARTUP_ID env variable is set.
StartupNotify bool
// The string that the program will set as WM Class or WM name
// hint.
StartupWMClass string
// Extended pairs. These are all of the key=value pairs in which
// the key follows the format X-PRODUCT-KEY. For example,
// accessing X-Unity-IconBackgroundColor can be done with:
//
// entry.X["Unity"]["IconBackgroundColor"]
//
X map[string]map[string]string
}
Entry represents a desktop entry file.
func New ¶
New reads a desktop file from r and returns an Entry that represents the desktop file using the default locale.
func NewWithLocale ¶
NewWithLocale reads a desktop file from r and returns an Entry that represents the desktop file using the given locale l.
Click to show internal directories.
Click to hide internal directories.