Krolyxon
Commit 36149c1

Branches

Refs →

aurora36149c1

aurora: launch apps in their own scope, not aurora.service

Author
krolyxon
Date
2026-10-27 10:10 +0530
Parent
28f6ca0
Commit
36149c1943ea9e0e4e10eceb7643e2a798478620

+14 −8

5 files changed

  1. M .config/quickshell/aurora/Devices.qml +1 −1
  2. M .config/quickshell/aurora/Dock.qml +2 −2
  3. M .config/quickshell/aurora/Net.qml +1 −2
  4. M .config/quickshell/aurora/Runner.qml +3 −3
  5. M .config/quickshell/aurora/Session.qml +7 −0
M .config/quickshell/aurora/Devices.qml View
@@ -34,7 +34,7 @@ Singleton {
3434 if (phones[i].key === key && phones[i].mounted) { xdgOpen(phones[i].path); return true }
3535 return false
3636 }
37− function xdgOpen(path) { Quickshell.execDetached(["xdg-open", path]) }
37+ function xdgOpen(path) { Session.launch(["xdg-open", path]) }
3838 // unmount this filesystem and lock its LUKS container; the disk stays powered, so it can be mounted again
3939 function eject(key) {
4040 if (key.indexOf("mtp://") === 0) {
M .config/quickshell/aurora/Dock.qml View
@@ -66,7 +66,7 @@ PanelWindow {
6666 }
6767
6868 function activate(a) {
69− if (a.wins.length === 0) { if (a.entry) a.entry.execute(); return }
69+ if (a.wins.length === 0) { if (a.entry) Session.launch(a.entry.command, a.entry.workingDirectory); return }
7070 // focus the next window of that app after the active one (cycles)
7171 var act = Hyprland.activeToplevel, i = -1
7272 for (var k = 0; k < a.wins.length; k++) if (act && a.wins[k].address === act.address) i = k
@@ -166,7 +166,7 @@ PanelWindow {
166166 onEntered: { hide.stop(); win.shown = true }
167167 onClicked: m => {
168168 if (m.button === Qt.RightButton) Settings.togglePin(cell.modelData.id)
169− else if (m.button === Qt.MiddleButton) { if (cell.modelData.entry) cell.modelData.entry.execute() }
169+ else if (m.button === Qt.MiddleButton) { if (cell.modelData.entry) Session.launch(cell.modelData.entry.command, cell.modelData.entry.workingDirectory) }
170170 else win.activate(cell.modelData)
171171 }
172172 }
M .config/quickshell/aurora/Net.qml View
@@ -96,8 +96,7 @@ Singleton {
9696 }
9797
9898 function openPortal() {
99− Quickshell.execDetached(["sh", "-c", 'exec ${BROWSER:-xdg-open} "$1"', "sh",
100− portalUrl !== "" ? portalUrl : probeUrl])
99+ Session.launch(["sh", "-c", 'exec ${BROWSER:-xdg-open} "$1"', "sh", portalUrl !== "" ? portalUrl : probeUrl])
101100 }
102101
103102 // manual "sign in" (IPC): open the portal if there is one, else say why not
M .config/quickshell/aurora/Runner.qml View
@@ -322,7 +322,7 @@ PanelWindow {
322322
323323 // ---- launching ----
324324 function exec(cmd, term) {
325− Quickshell.execDetached({ command: term ? ["foot", "-e"].concat(cmd) : cmd, workingDirectory: home })
325+ Session.launch(term ? ["foot", "-e"].concat(cmd) : cmd, home)
326326 }
327327 function trigger(i, term) {
328328 if (dmenu) {
@@ -343,9 +343,9 @@ PanelWindow {
343343 switch (it.kind) {
344344 case "app":
345345 if (term || it.entry.runInTerminal) exec(it.entry.command, true)
346− else it.entry.execute()
346+ else Session.launch(it.entry.command, it.entry.workingDirectory)
347347 break
348− case "act": it.action.execute(); break
348+ case "act": Session.launch(it.action.command); break
349349 case "bin": exec([it.name], term); break
350350 case "sh": exec(["sh", "-c", it.name], term); break
351351 case "calc": if (it.value !== "") Quickshell.execDetached(["wl-copy", "--", it.value]); break
M .config/quickshell/aurora/Session.qml View
@@ -15,6 +15,13 @@ Singleton {
1515 { id: "display", icon: Theme.iMonitor, label: "display off", confirm: false }
1616 ]
1717
18+ // Start an app in its own systemd scope. Spawned straight from quickshell it would sit in aurora.service's cgroup:
19+ // killed on every `systemctl --user restart aurora`, and one that ignores SIGTERM stalls the restart for 90s.
20+ function launch(cmd, wd) {
21+ Quickshell.execDetached({ command: ["systemd-run", "--user", "--scope", "--quiet", "--collect", "--"].concat(cmd),
22+ workingDirectory: wd || Quickshell.env("HOME") })
23+ }
24+
1825 function run(id) {
1926 switch (id) {
2027 case "lock": Quickshell.execDetached(["loginctl", "lock-session"]); break