parent
b190da36d8
commit
5421a18067
@ -1,10 +1,24 @@
|
||||
# DBus session bus over SSH with X11 forwarding
|
||||
if ( $?SSH_CONNECTION == 0 ) exit
|
||||
if ( $?XDG_SESSION_ID == 0) exit
|
||||
if ( $?DISPLAY == 0 ) exit
|
||||
if ( $SHLVL > 1 ) exit
|
||||
|
||||
set DBUS_SESSIONS = "${XDG_RUNTIME_DIR}/dbus-1/sessions"
|
||||
set DBUS_SESSION_ADDRESS_FILE = "${DBUS_SESSIONS}/${XDG_SESSION_ID}"
|
||||
|
||||
if ( -e "${DBUS_SESSION_ADDRESS_FILE}" ) then
|
||||
setenv DBUS_SESSION_BUS_ADDRESS "`cat ${DBUS_SESSION_ADDRESS_FILE}`"
|
||||
exit
|
||||
endif
|
||||
|
||||
setenv GDK_BACKEND x11
|
||||
|
||||
eval `dbus-launch --csh-syntax`
|
||||
|
||||
if ( $?DBUS_SESSION_BUS_PID == 0 ) exit
|
||||
|
||||
mkdir -p "${DBUS_SESSIONS}"
|
||||
echo "${DBUS_SESSION_BUS_ADDRESS}" > "${DBUS_SESSION_ADDRESS_FILE}"
|
||||
|
||||
setsid -f /usr/libexec/dbus-1/dbus-kill-process-with-session $DBUS_SESSION_BUS_PID
|
||||
|
@ -1,12 +1,25 @@
|
||||
# DBus session bus over SSH with X11 forwarding
|
||||
[ -z "$SSH_CONNECTION" ] && return
|
||||
[ -z "$XDG_SESSION_ID" ] && return
|
||||
[ -z "$DISPLAY" ] && return
|
||||
[ "${DISPLAY:0:1}" = ":" ] && return
|
||||
[ "$SHLVL" -ne 1 ] && return
|
||||
|
||||
DBUS_SESSIONS="${XDG_RUNTIME_DIR}/dbus-1/sessions"
|
||||
DBUS_SESSION_ADDRESS_FILE="${DBUS_SESSIONS}/${XDG_SESSION_ID}"
|
||||
|
||||
if [ -e "${DBUS_SESSION_ADDRESS_FILE}" ]; then
|
||||
export DBUS_SESSION_BUS_ADDRESS="$(cat ${DBUS_SESSION_ADDRESS_FILE})"
|
||||
return
|
||||
fi
|
||||
|
||||
export GDK_BACKEND=x11
|
||||
|
||||
eval `dbus-launch --sh-syntax`
|
||||
|
||||
[ -z "$DBUS_SESSION_BUS_PID" ] && return
|
||||
|
||||
mkdir -p "${DBUS_SESSIONS}"
|
||||
echo "${DBUS_SESSION_BUS_ADDRESS}" > "${DBUS_SESSION_ADDRESS_FILE}"
|
||||
|
||||
setsid -f /usr/libexec/dbus-1/dbus-kill-process-with-session "$DBUS_SESSION_BUS_PID"
|
||||
|
Loading…
Reference in new issue