desktopfile

Reading, writing and executing .desktop file

Members

Classes

DesktopFile
class DesktopFile

Represents .desktop file.

DesktopFileException
class DesktopFileException

Exception thrown when error occures during the .desktop file read.

DesktopGroup
class DesktopGroup

This class represents the group in the desktop file. You can create and use instances of this class only in the context of DesktopFile instance.

Functions

checkTryExec
bool checkTryExec(string programPath)

Checks if the program exists and is executable. If the programPath is not an absolute path, the file is looked up in the $PATH environment variable. This function is defined only on Posix.

currentLocale
string currentLocale()

Retrieves current locale probing environment variables LC_TYPE, LC_ALL and LANG (in this order)

doUnescape
string doUnescape(string value, Tuple!(char, char)[] pairs)
Undocumented in source. Be warned that the author may not have intended to support it.
escapeValue
string escapeValue(string value)
Undocumented in source. Be warned that the author may not have intended to support it.
isBoolean
bool isBoolean(string value)

Check if the desktop entry value can be interpreted as boolean value.

isFalse
bool isFalse(string value)

Tells whether the desktop entry value presents false

isTrue
bool isTrue(string value)

Tells whether the dekstop entry value presents true

isValidKey
bool isValidKey(string key)

Tells whethe the string is valid dekstop entry key. Note: This does not include characters presented in locale names. Use separateFromLocale to get non-localized key to pass it to this function

isValidKeyChar
bool isValidKeyChar(char c)

Tells whether the character is valid for desktop entry key. Note: This does not include characters presented in locale names.

localizedKey
string localizedKey(string key, string locale)
localizedKey
string localizedKey(string key, string lang, string country, string modifier)

Ditto, but constructs locale name from arguments.

makeLocaleName
string makeLocaleName(string lang, string country, string encoding, string modifier)
parseLocaleName
auto parseLocaleName(string locale)

Parses locale name into the tuple of 4 values corresponding to language, country, encoding and modifier

separateFromLocale
Tuple!(string, string) separateFromLocale(string key)

Separates key name into non-localized key and locale name. If key is not localized returns original key and empty string.

unescapeExec
string unescapeExec(string str)
Undocumented in source. Be warned that the author may not have intended to support it.
unescapeValue
string unescapeValue(string value)
Undocumented in source. Be warned that the author may not have intended to support it.

See Also

Meta