|
|
@ -3,17 +3,39 @@
|
|
|
|
# Allow local and docker connections to X11 on the host
|
|
|
|
# Allow local and docker connections to X11 on the host
|
|
|
|
xhost + local:docker >/dev/null
|
|
|
|
xhost + local:docker >/dev/null
|
|
|
|
|
|
|
|
|
|
|
|
# TODO: Add /media to mapped directories to allow removable media
|
|
|
|
# Populate required variables if empty
|
|
|
|
|
|
|
|
[ "${USER}" = "" ] && USER=$(whoami)
|
|
|
|
|
|
|
|
[ "${HOME}" = "" ] && HOME="/home/${USER}"
|
|
|
|
|
|
|
|
[ "${HOSTNAME}" = "" ] && HOSTNAME=$(hostname)
|
|
|
|
|
|
|
|
[ "${UID}" = "" ] && UID=$(id -u)
|
|
|
|
|
|
|
|
[ "${GID}" = "" ] && GID=$(id -g "${USER}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Include /media/$USER folder if it exists for removable media
|
|
|
|
|
|
|
|
if [ -d "/media/${USER}" ]; then
|
|
|
|
|
|
|
|
echo "Finding mounted removable media:"
|
|
|
|
|
|
|
|
for i in $(find "/media/${USER}/" -mindepth 1 -maxdepth 1 -type d); do
|
|
|
|
|
|
|
|
echo " Found ${i}"
|
|
|
|
|
|
|
|
USER_MEDIA_DIR_ARG="${USER_MEDIA_DIR_ARG} -v ${i}:${i}"
|
|
|
|
|
|
|
|
done
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Notebook writes some licensing data under /opt, so this
|
|
|
|
|
|
|
|
# dir gets mapped to the current users home directory too
|
|
|
|
|
|
|
|
LICENSE_DIR="${HOME}/.config/smart-notebook-license"
|
|
|
|
|
|
|
|
LICENSE_DIR_CONTAINER="/opt/SMART Technologies/common/data/"
|
|
|
|
|
|
|
|
[ ! -d "${LICENSE_DIR}" ] && mkdir -p "${LICENSE_DIR}"
|
|
|
|
|
|
|
|
|
|
|
|
# Run docker container
|
|
|
|
# Run docker container
|
|
|
|
docker run \
|
|
|
|
docker run \
|
|
|
|
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
|
|
|
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
|
|
|
-v ${HOME}:${HOME} \
|
|
|
|
-v "${LICENSE_DIR}":"${LICENSE_DIR_CONTAINER}" \
|
|
|
|
-e DISPLAY=${DISPLAY} \
|
|
|
|
-v "${HOME}":"${HOME}" \
|
|
|
|
-e HOME=${HOME} \
|
|
|
|
${USER_MEDIA_DIR_ARG} \
|
|
|
|
-e USER=${USER} \
|
|
|
|
-e DISPLAY="${DISPLAY}" \
|
|
|
|
-e UID=${UID} \
|
|
|
|
-e HOME="${HOME}" \
|
|
|
|
-e GID=$(id -g ${USER}) \
|
|
|
|
-e USER="${USER}" \
|
|
|
|
-e SMART_ARGS=${@} \
|
|
|
|
-e UID="${UID}" \
|
|
|
|
-h ${HOSTNAME} \
|
|
|
|
-e GID="${GID}" \
|
|
|
|
notebook-gui
|
|
|
|
-e SMART_ARGS="${@}" \
|
|
|
|
|
|
|
|
-h "${HOSTNAME}" \
|
|
|
|
|
|
|
|
notebook-gui
|
|
|
|