pub struct DesktopEntry {
pub entry_type: EntryType,
pub version: Option<String>,
pub name: LocaleString,
pub generic_name: Option<LocaleString>,
pub no_display: Option<bool>,
pub comment: Option<LocaleString>,
pub icon: Option<IconString>,
pub hidden: Option<bool>,
pub only_show_in: Option<Vec<String>>,
pub not_show_in: Option<Vec<String>>,
pub dbus_activatable: Option<bool>,
}
Expand description
Represents a complete desktop entry, containing all the standard fields defined in the freedesktop.org specification.
Fields§
§entry_type: EntryType
This specification defines 3 types of desktop entries: Application (type 1), Link (type 2) and Directory (type 3). To allow the addition of new types in the future, implementations should ignore desktop entries with an unknown type.
version: Option<String>
Version of the Desktop Entry Specification that the desktop entry conforms with. Entries that confirm with this version of the specification should use 1.5. Note that the version field is not required to be present.
name: LocaleString
Specific name of the application, for example “Mozilla”.
generic_name: Option<LocaleString>
Generic name of the application, for example “Web Browser”.
no_display: Option<bool>
NoDisplay means “this application exists, but don’t display it in the menus”. This can be useful to e.g. associate this application with MIME types, so that it gets launched from a file manager (or other apps), without having a menu entry for it (there are tons of good reasons for this, including e.g. the netscape -remote, or kfmclient openURL kind of stuff).
comment: Option<LocaleString>
Tooltip for the entry, for example “View sites on the Internet”. The value should not be redundant with the values of Name and GenericName.
icon: Option<IconString>
Icon to display in file manager, menus, etc. If the name is an absolute path, the given file will be used. If the name is not an absolute path, the algorithm described in the Icon Theme Specification will be used to locate the icon.
Hidden should have been called Deleted. It means the user deleted (at their level) something that was present (at an upper level, e.g. in the system dirs). It’s strictly equivalent to the .desktop file not existing at all, as far as that user is concerned. This can also be used to “uninstall” existing files (e.g. due to a renaming) - by letting make install install a file with Hidden=true in it.
only_show_in: Option<Vec<String>>
A list of strings identifying the desktop environments that should display/not display a given desktop entry. By default, a desktop file should be shown, unless an OnlyShowIn key is present, in which case, the default is for the file not to be shown. If $XDG_CURRENT_DESKTOP is set then it contains a colon-separated list of strings. In order, each string is considered. If a matching entry is found in OnlyShowIn then the desktop file is shown. If an entry is found in NotShowIn then the desktop file is not shown. If none of the strings match then the default action is taken (as above). $XDG_CURRENT_DESKTOP should have been set by the login manager, according to the value of the DesktopNames found in the session file. The entry in the session file has multiple values separated in the usual way: with a semicolon. The same desktop name may not appear in both OnlyShowIn and NotShowIn of a group.
not_show_in: Option<Vec<String>>
A list of strings identifying the desktop environments that should display/not display a given desktop entry. By default, a desktop file should be shown, unless an OnlyShowIn key is present, in which case, the default is for the file not to be shown. If $XDG_CURRENT_DESKTOP is set then it contains a colon-separated list of strings. In order, each string is considered. If a matching entry is found in OnlyShowIn then the desktop file is shown. If an entry is found in NotShowIn then the desktop file is not shown. If none of the strings match then the default action is taken (as above). $XDG_CURRENT_DESKTOP should have been set by the login manager, according to the value of the DesktopNames found in the session file. The entry in the session file has multiple values separated in the usual way: with a semicolon. The same desktop name may not appear in both OnlyShowIn and NotShowIn of a group.
dbus_activatable: Option<bool>
A boolean value specifying if D-Bus activation is supported for this application. If this key is missing, the default value is false. If the value is true then implementations should ignore the Exec key and send a D-Bus message to launch the application. See D-Bus Activation for more information on how this works. Applications should still include Exec= lines in their desktop files for compatibility with implementations that do not understand the DBusActivatable key.
Trait Implementations§
Source§impl Clone for DesktopEntry
impl Clone for DesktopEntry
Source§fn clone(&self) -> DesktopEntry
fn clone(&self) -> DesktopEntry
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more