mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-10-10 13:27:21 -04:00
launcher: stop treating BAMF_DESKTOP_FILE_HINT as a snap marker (#3729)
This commit is contained in:
@@ -116,7 +116,7 @@ function classifyAppSource(app) {
|
||||
if (cmd0 === "flatpak" || exec.indexOf("flatpak run ") !== -1)
|
||||
return "flatpak";
|
||||
|
||||
if (cmd0 === "snap" || exec.indexOf("bamf_desktop_file_hint=") !== -1 || exec.indexOf("/snap/bin/") !== -1 || exec.indexOf("/snap/core") !== -1 || exec.indexOf("snap run ") === 0)
|
||||
if (cmd0 === "snap" || exec.indexOf("/snap/bin/") !== -1 || exec.indexOf("/snap/core") !== -1 || exec.indexOf("snap run ") === 0)
|
||||
return "snap";
|
||||
|
||||
if (/\.appimage(\s|$|")/i.test(execRaw) || id.indexOf("appimagekit_") === 0)
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
import { loadScript } from "./qml-script.mjs";
|
||||
|
||||
const utils = loadScript(new URL("../Modals/DLauncherV2/ControllerUtils.js", import.meta.url));
|
||||
|
||||
test("app source follows the binary, not BAMF_DESKTOP_FILE_HINT", () => {
|
||||
const cases = [
|
||||
["env BAMF_DESKTOP_FILE_HINT=/nix/store/abc-codex/share/applications/codex.desktop /nix/store/abc-codex/bin/codex %u", "nix"],
|
||||
["env BAMF_DESKTOP_FILE_HINT=/usr/share/applications/foo.desktop /usr/bin/foo", "system"],
|
||||
["env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/firefox_firefox.desktop /snap/bin/firefox %u", "snap"],
|
||||
["snap run spotify", "snap"],
|
||||
["/nix/store/def-chrome/bin/google-chrome-stable %U", "nix"]
|
||||
];
|
||||
for (const [exec, source] of cases)
|
||||
assert.equal(utils.classifyAppSource({ id: "app", execString: exec }), source, exec);
|
||||
});
|
||||
Reference in New Issue
Block a user