1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-11 07:52:50 -05:00

Add support for custom launch prefix, launch apps with niri msg action

spawn on niri
This commit is contained in:
bbedward
2025-09-20 11:54:46 -04:00
parent 0ba4ee74b5
commit 306a0c0e2d
7 changed files with 92 additions and 7 deletions

View File

@@ -21,6 +21,7 @@ Singleton {
detectElogindProcess.running = true
}
Process {
id: detectUwsmProcess
running: false
@@ -64,6 +65,26 @@ Singleton {
}
}
// * Apps
function launchDesktopEntry(desktopEntry) {
let cmd = desktopEntry.command
if (SessionData.launchPrefix && SessionData.launchPrefix.length > 0) {
const launchPrefix = SessionData.launchPrefix.trim().split(" ")
cmd = launchPrefix.concat(cmd)
}
// For niri spawn with niri msg action spawn --
if (CompositorService.isNiri) {
cmd = ["niri", "msg", "action", "spawn", "--"].concat(cmd)
}
Quickshell.execDetached({
command: cmd,
workingDirectory: desktopEntry.workingDirectory,
});
}
// * Session management
function logout() {
if (hasUwsm) {
uwsmLogout.running = true