Files
sunnypilot/.devcontainer/container_post_create.sh
Kacper Rączy 109515a208 devcontainer: expose host config, fix mac screen issues (#29932)
* export host config via .host/.env file. fix mac display issues

* append instead of replace for bashrc

* Log when mac display override happens

* Update xauthority path in json
old-commit-hash: dd26a1faad
2023-09-15 23:00:24 +02:00

15 lines
349 B
Bash
Executable File

#!/usr/bin/env bash
source .devcontainer/.host/.env
# override display flag for mac
if [[ $HOST_OS == darwin ]]; then
echo "Setting up DISPLAY override for macOS..."
cat <<EOF >> /root/.bashrc
if [ -n "\$DISPLAY" ]; then
DISPLAY_NUM=\$(echo "\$DISPLAY" | awk -F: '{print \$NF}')
export DISPLAY=host.docker.internal:\$DISPLAY_NUM
fi
EOF
fi