Struct libxdgkit::desktop_entry::DesktopEntry[][src]

pub struct DesktopEntry {
Show fields pub xdg_type: DesktopType, pub version: f32, pub name: Option<String>, pub generic_name: Option<String>, pub no_display: Option<bool>, pub comment: Option<String>, pub icon: Option<String>, pub hidden: Option<bool>, pub only_show_in: Option<Vec<String>>, pub not_show_in: Option<Vec<String>>, pub dbus_activatable: Option<bool>, pub try_exec: Option<String>, pub exec: Option<String>, pub path: Option<String>, pub terminal: Option<bool>, pub actions: Option<Vec<String>>, pub mime_type: Option<Vec<String>>, pub categories: Option<Vec<String>>, pub implements: Option<Vec<String>>, pub keywords: Option<Vec<String>>, pub startup_notify: Option<bool>, pub startup_wm_class: Option<String>, pub url: Option<String>, pub prefers_non_default_gpu: Option<bool>,
}
Expand description

Recognized desktop entry keys

XDG specs

Option<String> will be used for all localeString/String

Option<Vec<String>> for all localeString(s)/String(s)

Option<bool> will be used for all boolean

f32 for version number

DesktopType enumerates known “Type” fields and the “Unknown” reserved “Type”

type is a reserved word in rust, so it is called ‘xdg_type’

I copied and pasted the website here and made things rustified

No camelcase inside structs, all lowercase/underscore version of CamelCase

Comments are just because I didn’t delete the rest of the text from the webpage

Fields

xdg_type: DesktopType

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. Stringing YES

version: f32

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. Stringing NO 1-3

name: Option<String>

Specific name of the application, for example “Mozilla”. localeStringing YES 1-3

generic_name: Option<String>

Generic name of the application, for example “Web Browser”. localeStringing NO 1-3

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). boolean NO 1-3

comment: Option<String>

Tooltip for the entry, for example “View sites on the Internet”. The value should not be redundant with the values of Name and GenericName. localeStringing NO 1-3

icon: Option<String>

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. iconStringing NO 1-3

hidden: Option<bool>

Hidden should have been called Deleted. It means the user deleted (at his level) something that was present (at an upper level, e.g. in the system dirs). It’s Stringictly 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. boolean NO 1-3

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 Stringing 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. Stringing(s) NO 1-3

not_show_in: Option<Vec<String>>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. boolean NO

try_exec: Option<String>

Path to an executable file on disk used to determine if the program is actually installed. If the path is not an absolute path, the file is looked up in the $PATH environment variable. If the file is not present or if it is not executable, the entry may be ignored (not be used in menus, for example). Stringing NO 1

exec: Option<String>

Program to execute, possibly with arguments. See the Exec key for details on how this key works. The Exec key is required if DBusActivatable is not set to true. Even if DBusActivatable is true, Exec should be specified for compatibility with implementations that do not understand DBusActivatable. Stringing NO 1

path: Option<String>

If entry is of type Application, the working directory to run the program in. Stringing NO 1

terminal: Option<bool>

Whether the program runs in a terminal window. boolean NO 1

actions: Option<Vec<String>>

Identifiers for application actions. This can be used to tell the application to make a specific action, different from the default behavior. The Application actions section describes how actions work. Stringing(s) NO 1

mime_type: Option<Vec<String>>

The MIME type(s) supported by this application. Stringing(s) NO 1

categories: Option<Vec<String>>

Categories in which the entry should be shown in a menu (for possible values see the Desktop Menu Specification). Stringing(s) NO 1

implements: Option<Vec<String>>

A list of interfaces that this application implements. By default, a desktop file implements no interfaces. See Interfaces for more information on how this works. Stringing(s) NO

keywords: Option<Vec<String>>

A list of Strings which may be used in addition to other metadata to describe this entry. This can be useful e.g. to facilitate searching through entries. The values are not meant for display, and should not be redundant with the values of Name or GenericName. localeStringing(s) NO 1

startup_notify: Option<bool>

If true, it is KNOWN that the application will send a “remove” message when started with the DESKTOP_STARTUP_ID environment variable set. If false, it is KNOWN that the application does not work with startup notification at all (does not shown any window, breaks even when using StartupWMClass, etc.). If absent, a reasonable handling is up to implementations (assuming false, using StartupWMClass, etc.). (See the Startup Notification Protocol Specification for more details). boolean NO 1

startup_wm_class: Option<String>

If specified, it is known that the application will map at least one window with the given Stringing as its WM class or WM name hint (see the Startup Notification Protocol Specification for more details). Stringing NO 1

url: Option<String>

If entry is Link type, the URL to access. Stringing YES 2

prefers_non_default_gpu: Option<bool>

If true, the application prefers to be run on a more powerful discrete GPU if available, which we describe as “a GPU other than the default one” in this spec to avoid the need to define what a discrete GPU is and in which cases it might be considered more powerful than the default GPU. This key is only a hint and support might not be present depending on the implementation. boolean NO 1

Implementations

impl DesktopEntry[src]

Implementations

pub fn empty(initial_type: DesktopType) -> Self where
    Self: Sized
[src]

Creates a blank entry with a specified type

pub fn new(file_name: String) -> Self where
    Self: Sized
[src]

Creates a ‘new’ DesktopEntry from reading a file note: xdgkit does not check the file extention, you may want to This reads not only .desktop files but also .directory

Trait Implementations

impl Debug for DesktopEntry[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.