Allow different user in Archbox to access host user's X server and allow apps to run as Wayland-native.
This commit is contained in:
parent
b5f0e108d1
commit
9c69b290f1
13
archbox.bash
13
archbox.bash
@ -14,9 +14,18 @@ asroot(){
|
||||
[[ $EUID -ne 0 ]] && err "Run this as root!"
|
||||
}
|
||||
|
||||
#storeenv(){
|
||||
# echo $DBUS_SESSION_BUS_ADDRESS > /tmp/archbox_dbus_session_address
|
||||
# echo $XDG_RUNTIME_DIR > /tmp/archbox_xdg_runtime_dir
|
||||
#}
|
||||
|
||||
storeenv() {
|
||||
echo $DBUS_SESSION_BUS_ADDRESS > /tmp/archbox_dbus_session_address
|
||||
echo $XDG_RUNTIME_DIR > /tmp/archbox_xdg_runtime_dir
|
||||
echo "# This will be sourced when entering Archbox" > /tmp/archbox_env
|
||||
[[ ! -z $WAYLAND_DISPLAY ]] && echo "WAYLAND_DISPLAY=$WAYLAND_DISPLAY" >> /tmp/archbox_env
|
||||
[[ ! -z $DISPLAY ]] && checkdep xhost && xhost +local: > /dev/null \
|
||||
&& echo "DISPLAY=$DISPLAY" >> /tmp/archbox_env
|
||||
echo "DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS" >> /tmp/archbox_env
|
||||
echo "XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR" >> /tmp/archbox_env
|
||||
}
|
||||
|
||||
help_text(){
|
||||
|
@ -1,8 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source /etc/archbox.conf
|
||||
source /tmp/archbox_env
|
||||
|
||||
REQ_ENV="DBUS_SESSION_BUS_ADDRESS=$(cat /tmp/archbox_dbus_session_address) XDG_RUNTIME_DIR=$(cat /tmp/archbox_xdg_runtime_dir)"
|
||||
REQ_ENV="DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS "
|
||||
REQ_ENV+="XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR "
|
||||
[[ ! -z $DISPLAY ]] && REQ_ENV+="DISPLAY=$DISPLAY "
|
||||
[[ ! -z $WAYLAND_DISPLAY ]] && REQ_ENV+="WAYLAND_DISPLAY=$WAYLAND_DISPLAY "
|
||||
|
||||
ENV="$REQ_ENV $ENV_VAR"
|
||||
COMMAND="$@"
|
||||
|
Loading…
Reference in New Issue
Block a user