Files
glassMxrph/quickshell/services/ApplicationsService.qml
T
mxandClaude Opus 5.5 99e64a7713 Add glassMxrph shell sources
Initial commit of the Quickshell desktop suite: bar, dock, launcher,
settings, Control Center, dashboard, OSD, lock screen, desktop widgets,
plugin host with the vendored Noctalia/Omarchy compatibility layer,
helpers, packaging, tests and phase documentation.

Includes the optimization work so far: usage widgets and dashboard
gauges no longer animate continuously, desktop widgets pause while
covered, system controls stop flickering on background polls, dock app
matching uses an indexed catalog, and workspace ghosts are created only
for occupied slots.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 22:36:17 +02:00

40 lines
1.4 KiB
QML

pragma Singleton
import QtQuick
import Quickshell
import "AppMatching.js" as Matching
Singleton {
id: root
readonly property var entries: DesktopEntries.applications.values
readonly property var launchable: entries.filter(e => !e.noDisplay).slice().sort((a, b) => a.name.localeCompare(b.name))
property string error: ""
function byId(id) {
return entries.find(e => Matching.canonical(e.id) === Matching.canonical(id)) || null;
}
function icon(entry) {
return entry && entry.icon ? Quickshell.iconPath(entry.icon, true) : "";
}
function launch(entry, action) {
if (!entry) {
error = "This desktop entry is no longer installed.";
return false;
}
if (entry.runInTerminal) {
const terminal = ConfigService.data.dock.terminalCommand;
if (!terminal.length) {
error = "Set dock.terminalCommand to a terminal command argument array before launching terminal applications.";
return false;
}
Quickshell.execDetached({
command: terminal.concat(action ? action.command : entry.command),
workingDirectory: entry.workingDirectory
});
} else if (action)
action.execute();
else
entry.execute();
error = "";
return true;
}
}