diff --git a/quickshell/Modals/DankLauncherV2/ActionPanel.qml b/quickshell/Modals/DankLauncherV2/ActionPanel.qml index d26aa90c..c028252c 100644 --- a/quickshell/Modals/DankLauncherV2/ActionPanel.qml +++ b/quickshell/Modals/DankLauncherV2/ActionPanel.qml @@ -56,11 +56,6 @@ Rectangle { case "app": if (selectedItem?.isCore) break; - if (selectedItem?.actions) { - for (var i = 0; i < selectedItem.actions.length; i++) { - result.push(selectedItem.actions[i]); - } - } if (SessionService.nvidiaCommand) { result.push({ name: I18n.tr("Launch on dGPU"), @@ -68,6 +63,11 @@ Rectangle { action: "launch_dgpu" }); } + if (selectedItem?.actions) { + for (var i = 0; i < selectedItem.actions.length; i++) { + result.push(selectedItem.actions[i]); + } + } break; } return result; diff --git a/quickshell/Modals/DankLauncherV2/Controller.qml b/quickshell/Modals/DankLauncherV2/Controller.qml index 740197db..a1b086c3 100644 --- a/quickshell/Modals/DankLauncherV2/Controller.qml +++ b/quickshell/Modals/DankLauncherV2/Controller.qml @@ -1250,6 +1250,23 @@ Item { CacheData.saveLauncherCache(serializable); } + function _actionsFromDesktopEntry(appId) { + if (!appId) + return []; + var entry = DesktopEntries.heuristicLookup(appId); + if (!entry || !entry.actions || entry.actions.length === 0) + return []; + var result = []; + for (var i = 0; i < entry.actions.length; i++) { + result.push({ + name: entry.actions[i].name, + icon: "play_arrow", + actionData: entry.actions[i] + }); + } + return result; + } + function _loadDiskCache() { var cached = CacheData.loadLauncherCache(); if (!cached || !Array.isArray(cached) || cached.length === 0) @@ -1277,8 +1294,12 @@ Item { data: { id: it.id }, - actions: [], - primaryAction: null, + actions: _actionsFromDesktopEntry(it.id), + primaryAction: it.type === "app" && !it.isCore ? { + name: I18n.tr("Launch"), + icon: "open_in_new", + action: "launch" + } : null, _diskCached: true, _hName: "", _hSub: "",