Set up dbus for notify_cmd

This commit is contained in:
Peter Cai 2025-03-09 18:43:27 -04:00
parent 5e6c7a35cb
commit e8fc001023
2 changed files with 24 additions and 1 deletions

View file

@ -31,3 +31,15 @@ interface = "wl_data_offer"
requests = [ "receive" ]
action = "notify"
desc = "pasted from clipboard or accepted drag and drop"
[[filter.requests]]
interface = "zwp_pointer_constraints_v1"
requests = [ "lock_pointer", "confine_pointer" ]
action = "notify"
desc = "captured mouse pointer"
[[filter.requests]]
interface = "zwp_xwayland_keyboard_grab_manager_v1"
requests = [ "grab_keyboard" ]
action = "notify"
desc = "grabbed keyboard"

View file

@ -111,6 +111,17 @@ ensure_compositor_sandbox() {
mkdir -p "$sandbox_tmp/X11-unix"
cp "$script_path/assets/wl-mitm-config.toml" "$sandbox_tmp/wl-mitm-config.toml"
local comp_extra_args=""
local dbus_src=""
if [ ! -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
dbus_src="$(echo "$DBUS_SESSION_BUS_ADDRESS" | cut -d"=" -f2)"
if [ -S "$dbus_src" ]; then
log "Found dbus address $dbus_src, passing to wl-mitm for notify_cmd usage"
comp_extra_args="$extra_args -v $dbus_src:/tmp/dbus -e DBUS_SESSION_BUS_ADDRESS=unix:path=/tmp/dbus"
fi
fi
log "Starting compositor-sandbox (wl-mitm for Wayland and X Sommelier for X11)..."
podman run --rm -d "${podman_security_args[@]}" --name $sandbox_name \
@ -123,7 +134,7 @@ ensure_compositor_sandbox() {
-v "$sandbox_tmp/X11-unix":/tmp/.X11-unix \
`# DRM render nodes` \
-v /dev/dri:/dev/dri \
dobu/deps-compositor-sandbox
$comp_extra_args dobu/deps-compositor-sandbox
while [ ! -S "$sandbox_tmp/xdg_runtime/wayland-10" ] || [ ! -S "$sandbox_tmp/X11-unix/X1" ]; do
sleep 0.5
done