1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-12 16:52:10 -04:00

launcher: add option to launch apps on dGPU by default

fixes #2027
This commit is contained in:
bbedward
2026-03-19 13:28:48 -04:00
parent 7f8b260560
commit 19c786c0be
2 changed files with 22 additions and 5 deletions

View File

@@ -211,12 +211,14 @@ Singleton {
function launchDesktopEntry(desktopEntry, useNvidia) {
let cmd = desktopEntry.command;
if (useNvidia && nvidiaCommand)
cmd = [nvidiaCommand].concat(cmd);
const appId = desktopEntry.id || desktopEntry.execString || desktopEntry.exec || "";
const override = SessionData.getAppOverride(appId);
const dgpu = useNvidia || (override?.launchOnDgpu && nvidiaCommand);
if (dgpu && nvidiaCommand)
cmd = [nvidiaCommand].concat(cmd);
if (override?.extraFlags) {
const extraArgs = override.extraFlags.trim().split(/\s+/).filter(arg => arg.length > 0);
cmd = cmd.concat(extraArgs);
@@ -265,7 +267,11 @@ Singleton {
function launchDesktopAction(desktopEntry, action, useNvidia) {
let cmd = action.command;
if (useNvidia && nvidiaCommand)
const appId = desktopEntry.id || desktopEntry.execString || desktopEntry.exec || "";
const override = SessionData.getAppOverride(appId);
const dgpu = useNvidia || (override?.launchOnDgpu && nvidiaCommand);
if (dgpu && nvidiaCommand)
cmd = [nvidiaCommand].concat(cmd);
const userPrefix = SettingsData.launchPrefix?.trim() || "";