pub struct DesktopEntry {
pub appid: String,
pub groups: Groups,
pub path: PathBuf,
pub ubuntu_gettext_domain: Option<String>,
}Fields§
§appid: String§groups: Groups§path: PathBuf§ubuntu_gettext_domain: Option<String>Implementations§
Source§impl DesktopEntry
impl DesktopEntry
pub fn from_str<L>( path: impl Into<PathBuf>, input: &str, locales_filter: Option<&[L]>, ) -> Result<DesktopEntry, DecodeError>
Sourcepub fn from_path<L>(
path: impl Into<PathBuf>,
locales_filter: Option<&[L]>,
) -> Result<DesktopEntry, DecodeError>
pub fn from_path<L>( path: impl Into<PathBuf>, locales_filter: Option<&[L]>, ) -> Result<DesktopEntry, DecodeError>
Return an owned DesktopEntry
Source§impl DesktopEntry
impl DesktopEntry
pub fn parse_exec(&self) -> Result<Vec<String>, ExecError>
Sourcepub fn parse_exec_with_uris<L>(
&self,
uris: &[&str],
locales: &[L],
) -> Result<Vec<String>, ExecError>
pub fn parse_exec_with_uris<L>( &self, uris: &[&str], locales: &[L], ) -> Result<Vec<String>, ExecError>
Macros like %f (cf .desktop spec) will be subtitued using the uris parameter.
pub fn parse_exec_action( &self, action_name: &str, ) -> Result<Vec<String>, ExecError>
pub fn parse_exec_action_with_uris<L>( &self, action_name: &str, uris: &[&str], locales: &[L], ) -> Result<Vec<String>, ExecError>
Source§impl DesktopEntry
impl DesktopEntry
Sourcepub fn from_appid(appid: String) -> DesktopEntry
pub fn from_appid(appid: String) -> DesktopEntry
Construct a new DesktopEntry from an appid. The name field will be
set to that appid.
Sourcepub fn matches_wm_class(&self, id: Ascii<&str>) -> bool
pub fn matches_wm_class(&self, id: Ascii<&str>) -> bool
Entries with a matching StartupWMClass should be preferred over those that do not.
Sourcepub fn matches_id(&self, id: Ascii<&str>) -> bool
pub fn matches_id(&self, id: Ascii<&str>) -> bool
Match entry by desktop entry file name
pub fn matches_name(&self, name: Ascii<&str>) -> bool
Source§impl DesktopEntry
impl DesktopEntry
pub fn id(&self) -> &str
Sourcepub fn desktop_entry(&self, key: &str) -> Option<&str>
pub fn desktop_entry(&self, key: &str) -> Option<&str>
A desktop entry field if any field under the [Desktop Entry] section.
pub fn desktop_entry_localized<'a, L: AsRef<str>>( &'a self, key: &str, locales: &[L], ) -> Option<Cow<'a, str>>
Sourcepub fn add_desktop_entry(&mut self, key: String, value: String)
pub fn add_desktop_entry(&mut self, key: String, value: String)
Insert a new field to this DesktopEntry, in the [Desktop Entry] section, removing
the previous value and locales in any.
pub fn name<L: AsRef<str>>(&self, locales: &[L]) -> Option<Cow<'_, str>>
pub fn generic_name<L: AsRef<str>>(&self, locales: &[L]) -> Option<Cow<'_, str>>
Sourcepub fn full_name<L: AsRef<str>>(&self, locales: &[L]) -> Option<Cow<'_, str>>
pub fn full_name<L: AsRef<str>>(&self, locales: &[L]) -> Option<Cow<'_, str>>
Get the full name of an application, and fall back to the name if that fails.
pub fn icon(&self) -> Option<&str>
Sourcepub fn comment<'a, L: AsRef<str>>(
&'a self,
locales: &[L],
) -> Option<Cow<'a, str>>
pub fn comment<'a, L: AsRef<str>>( &'a self, locales: &[L], ) -> Option<Cow<'a, str>>
This is an human readable description of the desktop file.
pub fn exec(&self) -> Option<&str>
Sourcepub fn try_exec(&self) -> Option<&str>
pub fn try_exec(&self) -> Option<&str>
Path or name of an executable to check if app is really installed
pub fn dbus_activatable(&self) -> bool
Sourcepub fn categories(&self) -> Option<Vec<&str>>
pub fn categories(&self) -> Option<Vec<&str>>
Return categories
Sourcepub fn keywords<'a, L: AsRef<str>>(
&'a self,
locales: &[L],
) -> Option<Vec<Cow<'a, str>>>
pub fn keywords<'a, L: AsRef<str>>( &'a self, locales: &[L], ) -> Option<Vec<Cow<'a, str>>>
Return keywords
Sourcepub fn implements(&self) -> Option<Vec<&str>>
pub fn implements(&self) -> Option<Vec<&str>>
List of D-Bus interfaces supported by this application
Sourcepub fn no_display(&self) -> bool
pub fn no_display(&self) -> bool
Application exists but shouldn’t be shown in menus
Sourcepub fn only_show_in(&self) -> Option<Vec<&str>>
pub fn only_show_in(&self) -> Option<Vec<&str>>
Desktop environments that should display this application
Sourcepub fn not_show_in(&self) -> Option<Vec<&str>>
pub fn not_show_in(&self) -> Option<Vec<&str>>
Desktop environments that should not display this application
Treat application as if it does not exist
pub fn flatpak(&self) -> Option<&str>
pub fn prefers_non_default_gpu(&self) -> bool
pub fn startup_notify(&self) -> bool
pub fn startup_wm_class(&self) -> Option<&str>
pub fn terminal(&self) -> bool
Sourcepub fn single_main_window(&self) -> bool
pub fn single_main_window(&self) -> bool
The app has a single main window only
pub fn type_(&self) -> Option<&str>
pub fn actions(&self) -> Option<Vec<&str>>
Sourcepub fn action_entry(&self, action: &str, key: &str) -> Option<&str>
pub fn action_entry(&self, action: &str, key: &str) -> Option<&str>
An action is defined as [Desktop Action actions-name] where action-name
is defined in the Actions field of [Desktop Entry].
Example: to get the Name field of this new-window action
[Desktop Action new-window]
Name=Open a New Windowyou will need to call
entry.action_entry("new-window", "Name")pub fn action_entry_localized<L: AsRef<str>>( &self, action: &str, key: &str, locales: &[L], ) -> Option<Cow<'_, str>>
pub fn action_name<'a, L: AsRef<str>>( &'a self, action: &str, locales: &[L], ) -> Option<Cow<'a, str>>
pub fn action_exec(&self, action: &str) -> Option<&str>
pub fn localized_entry_splitted<'a, L: AsRef<str>>( &'a self, group: Option<&'a Group>, key: &str, locales: &[L], ) -> Option<Vec<Cow<'a, str>>>
Trait Implementations§
Source§impl Clone for DesktopEntry
impl Clone for DesktopEntry
Source§fn clone(&self) -> DesktopEntry
fn clone(&self) -> DesktopEntry
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more