Desktop Entries¶
XDG Desktop Entry Specification
-
class
xdg.DesktopEntry.
DesktopEntry
(filename=None)[source]¶ Class to parse and validate Desktop Entries
-
__init__
(filename=None)[source]¶ Create a new DesktopEntry.
If filename exists, it will be parsed as a desktop entry file. If not, or if filename is None, a blank DesktopEntry is created.
-
new
(filename)[source]¶ Make this instance into a new, blank desktop entry.
If filename has a .desktop extension, Type is set to Application. If it has a .directory extension, Type is Directory. Other extensions will cause
ParsingError
to be raised.
-
parse
(file)[source]¶ Parse a desktop entry file.
This can raise
ParsingError
,DuplicateGroupError
orDuplicateKeyError
.
-
validate
(report='All')¶ Validate the contents, raising
ValidationError
if there is anything amiss.report can be ‘All’ / ‘Warnings’ / ‘Errors’
-
findTryExec
()[source]¶ Looks in the PATH for the executable given in the TryExec field.
Returns the full path to the executable if it is found, None if not. Raises
NoKeyError
if TryExec is not present.New in version 0.26.
-
getCategories
()[source]¶ -
getComment
()[source]¶ -
getExec
()[source]¶ -
getGenericName
()[source]¶ -
getHidden
()[source]¶ -
getIcon
()[source]¶ -
getMimeTypes
()[source]¶ -
getMiniIcon
()[source]¶ -
getName
()[source]¶ -
getNoDisplay
()[source]¶ -
getNotShowIn
()[source]¶ -
getOnlyShowIn
()[source]¶ -
getPath
()[source]¶ -
getProtocols
()[source]¶ -
getStartupNotify
()[source]¶ -
getStartupWMClass
()[source]¶ -
getTerminal
()[source]¶ -
getTerminalOptions
()[source]¶ -
getTryExec
()[source]¶ -
getType
()[source]¶ -
getURL
()[source]¶ -
getVersionString
()[source]¶ Convenience methods to get the values of specific fields. If the field is missing, these will simply return an empty or zero value. There are similar methods for deprecated and KDE specific keys, but these are not listed here.
-