Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OpenFileManager ¶
Types ¶
type DesktopEntry ¶
type DesktopEntry struct {
Exec string
}
DesktopEntry represents a parsed .desktop file's [Desktop Entry] section. This is a minimal parser that only extracts the fields we need, replacing the full gopkg.in/ini.v1 dependency (~34KB + 68 transitive deps).
func ParseDesktopFile ¶
func ParseDesktopFile(path string) (*DesktopEntry, error)
ParseDesktopFile parses a .desktop file and returns the Desktop Entry section. It follows the Desktop Entry Specification: ParseDesktopFile parses the `[Desktop Entry]` section of the desktop file at path and returns a DesktopEntry. It returns an error if the file cannot be opened or if parsing the file fails.
func ParseDesktopReader ¶
func ParseDesktopReader(r io.Reader) (*DesktopEntry, error)
ParseDesktopReader parses the [Desktop Entry] section of a .desktop file from r and extracts the Exec value. It ignores empty lines and lines starting with '#', treats section names as case-sensitive, and stops parsing after leaving the [Desktop Entry] section. The returned *DesktopEntry has Exec set to the exact value of the Exec key if present (whitespace preserved). An error is returned if reading from r fails.