dbus/SOURCES/ssh-x-forwarding.sh

13 lines
360 B
Bash
Raw Normal View History

2021-03-30 14:47:32 +00:00
# DBus session bus over SSH with X11 forwarding
[ -z "$SSH_CONNECTION" ] && return
[ -z "$DISPLAY" ] && return
2022-03-29 18:10:38 +00:00
[ "${DISPLAY:0:1}" = ":" ] && return
[ "$SHLVL" -ne 1 ] && return
2021-03-30 14:47:32 +00:00
2022-03-29 18:10:38 +00:00
export GDK_BACKEND=x11
eval `dbus-launch --sh-syntax`
[ -z "$DBUS_SESSION_BUS_PID" ] && return
setsid -f /usr/libexec/dbus-1/dbus-kill-process-with-session "$DBUS_SESSION_BUS_PID"