19 lines
785 B
Bash
Executable File
19 lines
785 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# orbit-menu in "classic dmenu" mode: pipe newline-delimited items on stdin, the
|
|
# radial menu opens with those items, and the chosen one is printed to stdout
|
|
# (exit 1, nothing printed, on cancel). Runs as its own throwaway process (NOT the
|
|
# resident daemon), so its stdout is the caller's.
|
|
#
|
|
# printf 'Logout\nLock\nReboot' | ~/.config/scripts/orbit-dmenu.sh
|
|
#
|
|
# Same LD_PRELOAD requirement as orbit-menu-start.sh: gtk4-layer-shell must load
|
|
# before libwayland-client, which isn't guaranteed under PyGObject.
|
|
|
|
APP="${HOME}/.config/orbit-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" --dmenu "$@"
|