1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-28 07:22:50 -05:00

Support prime-run

This commit is contained in:
bbedward
2025-10-06 20:50:36 -04:00
parent d9d83e5767
commit 4c3b7ca60f
4 changed files with 187 additions and 5 deletions

View File

@@ -18,6 +18,7 @@ Singleton {
property bool inhibitorAvailable: true
property bool idleInhibited: false
property string inhibitReason: "Keep system awake"
property bool hasPrimeRun: false
readonly property bool nativeInhibitorAvailable: {
try {
@@ -30,6 +31,7 @@ Singleton {
Component.onCompleted: {
detectElogindProcess.running = true
detectHibernateProcess.running = true
detectPrimeRunProcess.running = true
console.log("SessionService: Native inhibitor available:", nativeInhibitorAvailable)
}
@@ -65,6 +67,16 @@ Singleton {
}
}
Process {
id: detectPrimeRunProcess
running: false
command: ["which", "prime-run"]
onExited: function (exitCode) {
hasPrimeRun = (exitCode === 0)
}
}
Process {
id: uwsmLogout
command: ["uwsm", "stop"]
@@ -88,8 +100,11 @@ Singleton {
}
// * Apps
function launchDesktopEntry(desktopEntry) {
function launchDesktopEntry(desktopEntry, usePrimeRun) {
let cmd = desktopEntry.command
if (usePrimeRun && hasPrimeRun) {
cmd = ["prime-run"].concat(cmd)
}
if (SessionData.launchPrefix && SessionData.launchPrefix.length > 0) {
const launchPrefix = SessionData.launchPrefix.trim().split(" ")
cmd = launchPrefix.concat(cmd)
@@ -101,8 +116,11 @@ Singleton {
});
}
function launchDesktopAction(desktopEntry, action) {
function launchDesktopAction(desktopEntry, action, usePrimeRun) {
let cmd = action.command
if (usePrimeRun && hasPrimeRun) {
cmd = ["prime-run"].concat(cmd)
}
if (SessionData.launchPrefix && SessionData.launchPrefix.length > 0) {
const launchPrefix = SessionData.launchPrefix.trim().split(" ")
cmd = launchPrefix.concat(cmd)