Compare commits

...

4 commits

Author SHA1 Message Date
6f5dc01876
Changes for Anatase compatibility 2026-09-09 14:28:31 -05:00
sakanaa
f912f491e2
Add deprecation notice 2025-12-01 04:36:04 +01:00
Fisch03
13d5c3c75e bump version 2025-12-01 04:00:12 +01:00
Andrii Malytskyi
105cbaffb6
fix(#15): Fix get_flatpaks function; (#17) 2025-12-01 03:55:59 +01:00
6 changed files with 881 additions and 716 deletions

View file

@ -1,3 +1,6 @@
> [!TIP]
> This is a fork of [Quick Launch by Fisch03](https://github.com/Fisch03/SDH-QuickLaunch) that has been modified to work on [Anatase](https://anatase.org/). Since Anatase runs Steam in a Flatpak, launching other Flatpaks and apps doesn't normally work. The purpose of this fork is to replace calls to /usr/bin/flatpak to /app/bin/flatpak, which is a wrapper that allows launching other Flatpaks within Anatase's Steam package.
# SDH-QuickLaunch # SDH-QuickLaunch
[Decky Loader](https://github.com/SteamDeckHomebrew/PluginLoader) Plugin to quickly launch Apps from the Quick Access Menu without adding them as shortcuts, and add new shortcuts entirely [Decky Loader](https://github.com/SteamDeckHomebrew/PluginLoader) Plugin to quickly launch Apps from the Quick Access Menu without adding them as shortcuts, and add new shortcuts entirely

59
main.py
View file

@ -10,6 +10,8 @@ from subprocess import Popen, PIPE
from urllib.error import HTTPError from urllib.error import HTTPError
from urllib.request import urlopen, Request from urllib.request import urlopen, Request
FLATPAK_RUNNER = "flatpak" # or explicitly: /app/bin/flatpak
HOST_RUNNER = "hrun" # or explicitly: /app/bin/hrun
confdir = os.environ["DECKY_PLUGIN_SETTINGS_DIR"] confdir = os.environ["DECKY_PLUGIN_SETTINGS_DIR"]
@ -24,27 +26,58 @@ def split_string(string):
class Plugin: class Plugin:
async def get_flatpaks(self): async def get_flatpaks(self):
def read_proc(cmd): def list_flatpaks(cmd):
proc = Popen(cmd, stdout=PIPE, stderr=None, shell=True) flatpaks = []
flatpaks = proc.communicate()[0]
flatpaks = flatpaks.decode("utf-8") clean_env = os.environ.copy()
clean_env["LD_LIBRARY_PATH"] = ""
with Popen(cmd, stdout=PIPE, stderr=None, env=clean_env, text=True) as p:
for line in p.stdout:
if '\t' not in line:
continue
name, app_id = line.strip().split('\t', 1)
name = name.strip()
app_id = app_id.strip()
if not name or not app_id:
continue
flatpaks.append({
"id": app_id,
"name": name,
"exec": f"{FLATPAK_RUNNER} run {app_id}"
})
return flatpaks return flatpaks
# Global flatpak list global_flatpaks = list_flatpaks([
global_flatpaks = read_proc('flatpak list --app --columns="name,application" | awk \'BEGIN {FS="\\t"} {print "{\\"name\\":\\""$1"\\",\\"exec\\":\\"/usr/bin/flatpak run "$2"\\"},"}\\\'') 'flatpak', 'list', '--app', '--columns=name,application'
])
# User flatpak list local_flatpaks = list_flatpaks([
local_flatpaks = read_proc('runuser -l '+decky_plugin.DECKY_USER+' -c \'flatpak list --app --columns="name,application"\' | awk \'BEGIN {FS="\\t"} {print "{\\"name\\":\\""$1"\\",\\"exec\\":\\"/usr/bin/flatpak run "$2"\\"},"}\\\'') 'runuser', '-l', decky_plugin.DECKY_USER, '-c',
'flatpak list --app --columns=name,application'
])
packages = global_flatpaks + local_flatpaks[:-2] # Remove trailing comma seen = set()
return "[" + packages + "]" unique_flatpaks = []
for flatpak in global_flatpaks + local_flatpaks:
if flatpak["id"] not in seen:
seen.add(flatpak["id"])
unique_flatpaks.append(flatpak)
sorted_items = sorted(unique_flatpaks, key=lambda x: x.get("name", "").lower())
return jsonDumps(sorted_items)
async def get_desktops(self): async def get_desktops(self):
packages = [] packages = []
for desktopFile in chain( for desktopFile in chain(
Path("/usr/share/applications").glob("*.desktop"), Path("/usr/share/applications").glob("*.desktop"),
Path(f"{decky_plugin.DECKY_USER_HOME}/.local/share/applications/").glob("*.desktop"), Path(f"{decky_plugin.DECKY_USER_HOME}/.local/share/applications/").glob("*.desktop"),
Path("/var/usrlocal/share/applications").glob("*.desktop"),
): ):
if not desktopFile.is_file(): if not desktopFile.is_file():
continue continue
@ -58,8 +91,12 @@ class Plugin:
package["name"] = line[5:] package["name"] = line[5:]
elif line.startswith("Exec="): elif line.startswith("Exec="):
foundExec = True foundExec = True
package["exec"] = line[5:] execTarget = line[5:].split(" ", 1)
decky_plugin.logger.info("- Exec path: " + str(execTarget))
runner = FLATPAK_RUNNER if execTarget[0].endswith("flatpak") else HOST_RUNNER
package["exec"] = f"{runner} {execTarget[1]}"
if foundName and foundExec: if foundName and foundExec:
decky_plugin.logger.info("+ Desktop app: " + package["name"])
packages.append(package) packages.append(package)
break break

View file

@ -1,7 +1,7 @@
{ {
"name": "sdh-quicklaunch", "name": "sdh-quicklaunch-anatase",
"version": "1.2.0", "version": "1.2.1",
"description": "Quickly Launch Apps from the Steam Deck Quick Access Menu without adding them as Shortcuts", "description": "Quickly launch apps from the Steam Deck Quick Access Menu without adding them as shortcuts",
"scripts": { "scripts": {
"build": "shx rm -rf dist && rollup -c", "build": "shx rm -rf dist && rollup -c",
"watch": "rollup -c -w", "watch": "rollup -c -w",
@ -9,7 +9,7 @@
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/Fisch03/SDH-QuickLaunch.git" "url": "git+https://gitdab.com/dj/SDH-QuickLaunch-Anatase.git"
}, },
"keywords": [ "keywords": [
"decky", "decky",
@ -17,12 +17,12 @@
"steam-deck", "steam-deck",
"deck" "deck"
], ],
"author": "Fisch03", "author": "Fisch03 & djsime1",
"license": "GPL-3.0-or-later", "license": "GPL-3.0-or-later",
"bugs": { "bugs": {
"url": "https://github.com/Fisch03/SDH-QuickLaunch/issues" "url": "https://gitdab.com/dj/SDH-QuickLaunch-Anatase/issues"
}, },
"homepage": "https://github.com/Fisch03/SDH-QuickLaunch#readme", "homepage": "https://gitdab.com/dj/SDH-QuickLaunch-Anatase",
"devDependencies": { "devDependencies": {
"@rollup/plugin-commonjs": "^21.1.0", "@rollup/plugin-commonjs": "^21.1.0",
"@rollup/plugin-json": "^4.1.0", "@rollup/plugin-json": "^4.1.0",

View file

@ -1,11 +1,10 @@
{ {
"name": "Quick Launch", "name": "Quick Launch",
"author": "Fisch03", "author": "Fisch03 & djsime1",
"flags": ["root"], "flags": ["root"],
"publish": { "publish": {
"discord_id": "431374517462499328",
"description": "Quickly Launch Non-Steam-Apps from the Quick Access menu without adding them as Shortcuts, or add them to the Steam Library.", "description": "Quickly Launch Non-Steam-Apps from the Quick Access menu without adding them as Shortcuts, or add them to the Steam Library.",
"tags": [ "utility" ], "tags": [ "utility" ],
"image": "https://raw.githubusercontent.com/Fisch03/SDH-QuickLaunch/master/ui_full.png" "image": "https://gitdab.com/dj/SDH-QuickLaunch-Anatase/raw/branch/master/ui_full.png"
} }
} }

1598
pnpm-lock.yaml generated

File diff suppressed because it is too large Load diff

View file

@ -10,6 +10,7 @@ export async function launchApp(sAPI: ServerAPI, app: App) {
SteamClient.Apps.SetShortcutName(id, `[QL] ${app.name}`) SteamClient.Apps.SetShortcutName(id, `[QL] ${app.name}`)
SteamClient.Apps.SetShortcutLaunchOptions(id, getLaunchOptions(app)) SteamClient.Apps.SetShortcutLaunchOptions(id, getLaunchOptions(app))
SteamClient.Apps.SetShortcutExe(id, `"${getTarget(app)}"`) SteamClient.Apps.SetShortcutExe(id, `"${getTarget(app)}"`)
SteamClient.Apps.SetShortcutStartDir(id, "/app/bin")
SteamClient.Apps.SpecifyCompatTool(id, app.compatTool === undefined ? "" : app.compatTool) SteamClient.Apps.SpecifyCompatTool(id, app.compatTool === undefined ? "" : app.compatTool)
setTimeout(() => { setTimeout(() => {
@ -39,6 +40,7 @@ export function createAppShortcut(sAPI: ServerAPI, app: App, settings: Settings,
SteamClient.Apps.SetShortcutName(id, app.name); SteamClient.Apps.SetShortcutName(id, app.name);
SteamClient.Apps.SetShortcutLaunchOptions(id, shortcutLaunchOptions); SteamClient.Apps.SetShortcutLaunchOptions(id, shortcutLaunchOptions);
SteamClient.Apps.SetShortcutExe(id, `"${shortcutTarget}"`); SteamClient.Apps.SetShortcutExe(id, `"${shortcutTarget}"`);
SteamClient.Apps.SetShortcutStartDir(id, "/app/bin")
SteamClient.Apps.SpecifyCompatTool(id, app.compatTool === undefined ? "" : app.compatTool); SteamClient.Apps.SpecifyCompatTool(id, app.compatTool === undefined ? "" : app.compatTool);
}, 500) }, 500)
}) })