Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

applications

Installed desktop entries, indexed by window app_id.

text {
    content = computed({ mantle.workspaces, mantle.applications }, function(workspaces, applications)
        local client = workspaces and workspaces.active_client
        if client == nil or applications == nil then
            return ""
        end
        local index = applications.by_app_id[client.class]
        return index and applications.entries[index].name or client.class
    end),
}

State

mantle.applications:get() returns ApplicationsState, nil before the first push. A field marked ? may be absent.

mantle.applications payload.

FieldTypeDescription
by_app_idtable<string, integer>Window app_id to its 1-based index: entries[by_app_id[app_id]]. Keys are exact StartupWMClass and desktop ids, then lowercased and last-dot-segment guesses.
entriesAppSummary[]Installed entries, sorted by name (byte order). A change under an applications directory rescans 250 ms after the last event.

AppSummary

One visible Type=Application desktop entry; display data only, argv stays private.

FieldTypeDescription
comment?stringComment=, unlocalized, e.g. "Web Browser"; nil without the key.
generic_name?stringGenericName=, unlocalized, e.g. "Text Editor"; nil without the key.
icon?stringIcon= as written, a theme name or absolute path, both accepted by icon { name }; nil without the key.
idstringDesktop file id, e.g. "org.telegram.desktop"; the argument of "launch".
keywordsstring[]Keywords= split on ;, for search; empty without the key.
namestringName=, unlocalized: Name[xx] is not read.

Actions

Call each as mantle.applications:<action>(arguments...); ? marks an argument you may omit.

ActionArgumentsDescription
refreshRescans installed desktop entries. The directories are watched, so only a failed watch (logged) needs this.
launchid: stringLaunches entries[].id, detached; Terminal=true entries run in $TERMINAL.
open_urlurl: stringOpens an http, https or mailto URL with xdg-open. One over 2048 bytes or holding whitespace or a control character is refused.

Backend

Reads applications/ under $XDG_DATA_HOME, then each $XDG_DATA_DIRS entry (default /usr/local/share:/usr/share), subdirectories included. The first file for a desktop id wins, so a copy under ~/.local/share/applications overrides the system one. Type=Application entries with Name and Exec are listed; NoDisplay=true and Hidden=true ones are not. inotify watches every directory, including ones created later.

How do I…

TaskAnswer
Hide an app from a launcherCopy its .desktop file to ~/.local/share/applications and add NoDisplay=true; the rescan drops it

Gotchas

TrapFix
launch of a terminal app does nothingTerminal=true needs $TERMINAL in the Supervisor’s environment, not an interactive shell’s. mantle log names the refusal

See also: App launcher recipe.

Source: supervisor/src/capabilities/applications/