mirror of
https://github.com/webmin/webmin.git
synced 2026-05-06 15:20:29 +01:00
Fix to set XDG runtime and D-Bus env in xterm shells
Some checks failed
webmin.dev: webmin/webmin / build (push) Has been cancelled
Some checks failed
webmin.dev: webmin/webmin / build (push) Has been cancelled
https://github.com/webmin/webmin/issues/2679
This commit is contained in:
@@ -53,3 +53,17 @@ if [ -d ~/.bashrc.d ]; then
|
||||
done
|
||||
fi
|
||||
unset rc
|
||||
|
||||
# set XDG_RUNTIME_DIR and DBUS_SESSION_BUS_ADDRESS if not set
|
||||
if [ -z "$XDG_RUNTIME_DIR" ]; then
|
||||
uid=$(id -u)
|
||||
xdg_runtime_dir="/run/user/$uid"
|
||||
|
||||
if [ -d "$xdg_runtime_dir" ] && [ -O "$xdg_runtime_dir" ] && \
|
||||
[ -S "$xdg_runtime_dir/bus" ]; then
|
||||
export XDG_RUNTIME_DIR="$xdg_runtime_dir"
|
||||
export DBUS_SESSION_BUS_ADDRESS="unix:path=$XDG_RUNTIME_DIR/bus"
|
||||
fi
|
||||
|
||||
unset uid xdg_runtime_dir
|
||||
fi
|
||||
|
||||
@@ -22,3 +22,17 @@ fi
|
||||
if [ -f ~/.zshrc ]; then
|
||||
. ~/.zshrc
|
||||
fi
|
||||
|
||||
# set XDG_RUNTIME_DIR and DBUS_SESSION_BUS_ADDRESS if not set
|
||||
if [ -z "$XDG_RUNTIME_DIR" ]; then
|
||||
uid=$(id -u)
|
||||
xdg_runtime_dir="/run/user/$uid"
|
||||
|
||||
if [ -d "$xdg_runtime_dir" ] && [ -O "$xdg_runtime_dir" ] && \
|
||||
[ -S "$xdg_runtime_dir/bus" ]; then
|
||||
export XDG_RUNTIME_DIR="$xdg_runtime_dir"
|
||||
export DBUS_SESSION_BUS_ADDRESS="unix:path=$XDG_RUNTIME_DIR/bus"
|
||||
fi
|
||||
|
||||
unset uid xdg_runtime_dir
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user