diff --git a/desktopenvs/hyprlua/astal-menu/main.py b/desktopenvs/hyprlua/astal-menu/main.py index 3ca517c..c561aed 100755 --- a/desktopenvs/hyprlua/astal-menu/main.py +++ b/desktopenvs/hyprlua/astal-menu/main.py @@ -13,9 +13,18 @@ toggles the running instance without spawning a new process. from __future__ import annotations +import os import sys from pathlib import Path +# astal-menu-start.sh LD_PRELOADs libgtk4-layer-shell so it loads before +# libwayland-client (a load-ordering requirement of the layer-shell library). That +# only matters at *this* process's exec: the library is already resident now, so the +# variable is never read again. Drop it here so the GUI apps we launch via +# AstalApps.launch() (and the backend subprocesses) don't inherit it — Firefox, for +# one, aborts at startup with libgtk4-layer-shell preloaded. +os.environ.pop("LD_PRELOAD", None) + # Make sibling modules importable no matter the CWD. sys.path.insert(0, str(Path(__file__).resolve().parent)) diff --git a/desktopenvs/hyprlua/scripts/astal-menu-start.sh b/desktopenvs/hyprlua/scripts/astal-menu-start.sh index 0add692..78fc4a8 100755 --- a/desktopenvs/hyprlua/scripts/astal-menu-start.sh +++ b/desktopenvs/hyprlua/scripts/astal-menu-start.sh @@ -3,8 +3,10 @@ # # gtk4-layer-shell must be loaded before libwayland-client; when the shell is used # through PyGObject that ordering isn't guaranteed, so we LD_PRELOAD it (the library -# itself documents this workaround). Starts the daemon hidden — it shows only when -# menu-toggle.sh forwards a --toggle/--show/--appdrawer verb. +# itself documents this workaround). main.py drops LD_PRELOAD from its environment +# right after startup so the apps it launches don't inherit it (Firefox, for one, +# crashes with libgtk4-layer-shell preloaded). Starts the daemon hidden — it shows +# only when menu-toggle.sh forwards a --toggle/--show/--appdrawer verb. APP="${HOME}/.config/astal-menu/main.py" SO="$(ldconfig -p 2>/dev/null | awk '/libgtk4-layer-shell\.so/ {print $NF; exit}')"