feat(desktop): add desktop shell pref and plasma catalog

This commit is contained in:
xXJsonDeruloXx committed 2026-09-28 18:56:18 -04:00
1 parent 1af57b3ee7
commit e8cd001229
2 files changed
+24

No files matched your search

@@ -25,6 +25,12 @@ object DesktopCatalog {
*/
const val STEAM_SEED_URL = "https://raw.githubusercontent.com/The412Banner/winlator-contents/main/steam-seed.json"
const val PROTON_SEED_ID = "proton-arm64"
/**
* Desktop shells other than LXQt, built in this repo (tools/plasma, build-plasma.yml) and
* installed over the desktop package when one is chosen in the Desktop settings.
*/
const val SHELLS_URL = "https://raw.githubusercontent.com/Droid-Deck/DroidDeck/main/catalog/shells.json"
const val PLASMA_ID = "plasma"
class Entry(
val id: String, val name: String, val tier: Int, val version: String, val kind: String,
@@ -78,6 +84,10 @@ object DesktopCatalog {
fun desktopInstalled(context: Context): Boolean =
File(LinuxRuntime.rootDir(context), "usr/bin/labwc").isFile
/** KDE Plasma's package is in (droiddeck-desktop tests the same file). */
fun plasmaInstalled(context: Context): Boolean =
File(LinuxRuntime.rootDir(context), "usr/bin/kwin_wayland").isFile
/** Downloads, verifies and installs one package. Returns null on success, else a message. */
fun install(context: Context, entry: Entry, listener: LinuxRuntimeInstaller.ProgressListener?): String? {
val root = LinuxRuntime.rootDir(context)
@@ -419,6 +419,20 @@ object SessionPrefs {
java.io.File(com.droiddeck.launcher.runtime.LinuxRuntime.rootDir(context), "root/.droiddeck-renderer-failed").delete()
}
/**
* The desktop's shell: SHELL_LXQT (labwc, the desktop package) or SHELL_PLASMA (KWin, the plasma
* package over it, fetched at the next Desktop start when it is not in yet).
*/
fun desktopShell(context: Context): String =
prefs(context).getString("desktopShell", SHELL_LXQT)?.takeIf { it == SHELL_PLASMA } ?: SHELL_LXQT
fun setDesktopShell(context: Context, shell: String) {
prefs(context).edit().putString("desktopShell", shell).apply()
}
const val SHELL_LXQT = "lxqt"
const val SHELL_PLASMA = "plasma"
/**
* HDR10 output for MODE_STEAM / MODE_DESKTOP. Off by default. Honoured only when the panel
* lists HDR10 (HdrSupport), and decided when the compositor starts, which is once per app