Tweak Startup Script

This commit is contained in:
TheBrokenRail 2020-10-01 15:25:02 -04:00
parent 9198fff5b3
commit 48e963ba6f
2 changed files with 4 additions and 9 deletions

View File

@ -4,4 +4,4 @@ Maintainer: TheBrokenRail <connor24nolan@live.com>
Description: Fun with Blocks Description: Fun with Blocks
Homepage: https://www.minecraft.net/en-us/edition/pi Homepage: https://www.minecraft.net/en-us/edition/pi
Architecture: amd64 Architecture: amd64
Depends: docker.io, docker-compose, virgl-server, zenity, policykit-1, adduser Depends: docker.io, docker-compose, virgl-server, zenity, policykit-1, adduser, login

View File

@ -3,11 +3,8 @@
set -e set -e
# Ensure Features Are Selected # Ensure Features Are Selected
USER_LAUNCH=1 if [ -z "${MCPI_SUBSHELL}" ]; then
if [ -z "${MCPI_FEATURES}" ]; then
MCPI_FEATURES="$(zenity --class minecraft-pi --list --checklist --column 'Enabled' --column 'Feature' FALSE 'Touch GUI' FALSE 'Survival Mode' FALSE 'Fix Bow & Arrow' FALSE 'Fix Attacking' FALSE 'Mob Spawning')" MCPI_FEATURES="$(zenity --class minecraft-pi --list --checklist --column 'Enabled' --column 'Feature' FALSE 'Touch GUI' FALSE 'Survival Mode' FALSE 'Fix Bow & Arrow' FALSE 'Fix Attacking' FALSE 'Mob Spawning')"
else
USER_LAUNCH=0
fi fi
export MCPI_FEATURES export MCPI_FEATURES
@ -16,13 +13,11 @@ virgl_test_server &
VIRGL_PID="$!" VIRGL_PID="$!"
# Ensure Groups Are Correct # Ensure Groups Are Correct
if [ "${USER_LAUNCH}" = "1" ]; then if [ -z "${MCPI_SUBSHELL}" ]; then
if ! id -Gn "$(whoami)" | grep '\bdocker\b' > /dev/null; then if ! id -Gn "$(whoami)" | grep '\bdocker\b' > /dev/null; then
pkexec adduser "$(whoami)" docker pkexec adduser "$(whoami)" docker
fi fi
exec sg docker "env MCPI_SUBSHELL=1 \"$(realpath -e "$0")\""
su -p "$(whoami)" "$(realpath -e "$0")"
exit "$?"
fi fi
# Allow X11 Connections From Root # Allow X11 Connections From Root