Dotfiles/desktopenvs/hyprlua/scripts/astal-menu-start.sh

16 lines
645 B
Bash
Executable File

#!/usr/bin/env bash
# Resident launcher for the astal-menu GTK4 popup control centre.
#
# 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.
APP="${HOME}/.config/astal-menu/main.py"
SO="$(ldconfig -p 2>/dev/null | awk '/libgtk4-layer-shell\.so/ {print $NF; exit}')"
if [[ -n "${SO:-}" ]]; then
export LD_PRELOAD="${SO}${LD_PRELOAD:+:${LD_PRELOAD}}"
fi
exec python3 "$APP" "$@"