From 0baced681a69c55caa781bfc8b04cb53c1929361 Mon Sep 17 00:00:00 2001 From: lemniskett Date: Wed, 20 Jan 2021 15:17:45 +0700 Subject: [PATCH] Make Xorg-xhost optional. --- README.md | 2 +- archbox.bash | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6a3ae63..a42f826 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Ever since I'm running some niche distros like Void, Solus, I had a problem find - Wget - Tar - Desktop-file-utils -- Xorg-xhost +- Xorg-xhost (Optional: allowing users in Archbox to access X server) - Zenity (Optional: for .desktop entry manager GUI) ### Installing Archbox It's pretty easy, just run ```install.sh``` as root. diff --git a/archbox.bash b/archbox.bash index 9f2e359..aaa103b 100644 --- a/archbox.bash +++ b/archbox.bash @@ -17,8 +17,10 @@ asroot(){ storeenv() { 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 + if [[ ! -z $DISPLAY ]]; then + hash xhost >/dev/null 2>&1 && xhost +local: > /dev/null + echo "DISPLAY=$DISPLAY" >> /tmp/archbox_env + fi echo "DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS" >> /tmp/archbox_env echo "XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR" >> /tmp/archbox_env }