Launch apps in their own scope instead of the compositor's cgroup (#6541)
* Launch apps in their own scope instead of the compositor's cgroup
The launcher ran desktop entries through gtk-launch, so the app inherited
quickshell's cgroup, which belongs to wayland-wm@hyprland.desktop.service.
A kernel OOM kill there fails the compositor unit and tears down the whole
session, dropping the user at SDDM with every window lost. A single runaway
app took the desktop down three times in one afternoon.
Route launches through uwsm-app so each app gets its own scope under
app-graphical.slice. A runaway app now fails its own scope and the session
keeps running.
The post-install launches had the same inheritance bug in a milder form,
where the app landed in the installer terminal's scope and died with it.
0aedef58 patched that with setsid, which detaches the session but leaves
cgroup membership behind. A scope fixes it properly.
* Detach post-install app launches
* Preserve desktop entry launch compatibility
---------
Co-authored-by: David Heinemeier Hansson <david@hey.com>
This commit is contained in:
co-authored by
David Heinemeier Hansson
parent
fe55ac264d
commit
40f92eabdf
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Install a packaged app and gtk-launch it once it finishes
|
||||
# omarchy:summary=Install a packaged app and launch it once it finishes
|
||||
# omarchy:args=<display-name> <packages> <desktop-id>
|
||||
# omarchy:examples=omarchy install and launch Cursor cursor-bin cursor
|
||||
|
||||
@@ -13,5 +13,9 @@ if [[ -z $name || -z $packages || -z $desktop_id ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
printf -v install_message '%q' "Installing ${name}..."
|
||||
printf -v desktop_id_arg '%q' "$desktop_id"
|
||||
|
||||
# The subshell keeps & from backgrounding the package installation too.
|
||||
exec omarchy-launch-floating-terminal-with-presentation \
|
||||
"echo 'Installing ${name}...'; omarchy-pkg-add ${packages} && setsid gtk-launch ${desktop_id}"
|
||||
"echo ${install_message}; omarchy-pkg-add ${packages} && (setsid uwsm-app -- gtk-launch ${desktop_id_arg} >/dev/null 2>&1 &)"
|
||||
|
||||
@@ -6,4 +6,4 @@ echo "Installing Emacs..."
|
||||
omarchy-pkg-aur-add omarchy-emacs && omarchy-install-emacs
|
||||
|
||||
# emacsclient opens a frame on the running daemon, not a second Emacs
|
||||
setsid gtk-launch emacsclient
|
||||
setsid uwsm-app -- gtk-launch emacsclient >/dev/null 2>&1 &
|
||||
|
||||
@@ -26,4 +26,4 @@ printf '{\n "update.mode": "none"\n}\n' > ~/.config/Code/User/settings.json
|
||||
# Apply Omarchy theme to VSCode
|
||||
omarchy-theme-set-vscode
|
||||
|
||||
setsid gtk-launch code
|
||||
setsid uwsm-app -- gtk-launch code >/dev/null 2>&1 &
|
||||
|
||||
@@ -8,4 +8,4 @@ omarchy-pkg-add zed omazed
|
||||
# Apply Omarchy theme to Zed
|
||||
omazed setup
|
||||
|
||||
setsid gtk-launch dev.zed.Zed
|
||||
setsid uwsm-app -- gtk-launch dev.zed.Zed >/dev/null 2>&1 &
|
||||
|
||||
@@ -9,4 +9,4 @@ echo "Installing Heroic Games Launcher..."
|
||||
omarchy-pkg-add heroic-games-launcher-bin
|
||||
omarchy-install-gaming-gpu-lib32
|
||||
|
||||
setsid gtk-launch heroic >/dev/null 2>&1 &
|
||||
setsid uwsm-app -- gtk-launch heroic >/dev/null 2>&1 &
|
||||
|
||||
@@ -12,4 +12,4 @@ omarchy-install-gaming-gpu-lib32
|
||||
echo ""
|
||||
echo "Steam will start automatically now. This might take a while..."
|
||||
|
||||
setsid gtk-launch steam >/dev/null 2>&1 &
|
||||
setsid uwsm-app -- gtk-launch steam >/dev/null 2>&1 &
|
||||
|
||||
Reference in New Issue
Block a user