mirror of
https://github.com/fscotto/infra.git
synced 2026-05-30 23:49:56 +00:00
Add targeted Gufw compatibility for Sway sessions
- Remove the global xhost call from start-sway-session to keep Wayland startup clean - Add a dedicated gufw wrapper and desktop override that temporarily grants Xwayland access only for gufw
This commit is contained in:
22
dotfiles/desktop/.local/bin/run-gufw
Normal file
22
dotfiles/desktop/.local/bin/run-gufw
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
set -eu
|
||||
|
||||
if [ -z "${DISPLAY:-}" ]; then
|
||||
printf 'Error: DISPLAY is not set; cannot launch gufw under Xwayland.\n' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! command -v xhost >/dev/null 2>&1; then
|
||||
printf 'Error: xhost is required to launch gufw from a Wayland session.\n' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cleanup() {
|
||||
xhost -si:localuser:root >/dev/null 2>&1 || true
|
||||
}
|
||||
|
||||
trap cleanup EXIT INT TERM HUP
|
||||
|
||||
xhost si:localuser:root >/dev/null
|
||||
exec gufw "$@"
|
||||
Reference in New Issue
Block a user