mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-28 15:32:50 -05:00
Support prime-run
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user