pub struct DesktopEntries { /* private fields */ }Expand description
The installed applications, from cx.desktop_entries(). Cloning it
is cheap.
Implementations§
Source§impl DesktopEntries
impl DesktopEntries
Sourcepub fn applications(&self) -> ReadSignal<Vec<DesktopEntry>>
pub fn applications(&self) -> ReadSignal<Vec<DesktopEntry>>
Every application, sorted by name ignoring case, then by ID. Empty
until the loop’s next turn after the first cx.desktop_entries().
Sourcepub fn lookup(&self, app_id: &str) -> Option<DesktopEntry>
pub fn lookup(&self, app_id: &str) -> Option<DesktopEntry>
The application a window’s app id names, as a task bar finds the
window’s icon: the one with that ID, else one whose ID differs only
in case, else one whose StartupWMClass matches ignoring case,
else one whose ID ends in that part after a dot, as
org.gnome.Nautilus does for nautilus. It reads the list as
get does, so a binding that calls it runs again when the list
changes.
Sourcepub fn launch(&self, id: &str)
pub fn launch(&self, id: &str)
Starts the application with ID id, on its own: in a process
group of its own, with no input or output, and in its working_dir
if it has one. A terminal app runs through xdg-terminal-exec. One
that is dbus_activatable is
called with org.freedesktop.Application.Activate on the session
bus, which starts it if it isn’t running, and runs its Exec if
that fails. What can’t start is logged: an unknown ID, a malformed
Exec, a terminal app without xdg-terminal-exec on PATH, and a
D-Bus app that didn’t start with no Exec to fall back on.
When the compositor hands out activation tokens, the shell asks for
one first, with the app’s ID and the last click or key press on its
windows, and starts the app once it comes, or after 100 ms without
one. The token goes in XDG_ACTIVATION_TOKEN and
DESKTOP_STARTUP_ID for Exec, and in the platform data’s
activation-token and desktop-startup-id over D-Bus, so the
compositor may focus the app’s window.
Sourcepub fn launch_action(&self, id: &str, action: &str)
pub fn launch_action(&self, id: &str, action: &str)
Starts one of an application’s actions, named by its
DesktopAction::id, as launch does, a D-Bus
app’s with ActivateAction.