-
Notifications
You must be signed in to change notification settings - Fork 4
/
x11_test.sh
executable file
·38 lines (33 loc) · 992 Bytes
/
x11_test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
set -x
if [ `uname` == "Darwin" ]; then
# Check XQuartz installed
if ! which xquartz >/dev/null 2>&1; then
echo "ERROR: XQuartz does not appear to be installed"
exit 1
fi
# Allow localhost to access XQuartz if required
if ! xhost | grep "INET:localhost" >/dev/null 2>&1; then
echo "WARNING: Adding localhost to authorized xhost clients"
xhost + 127.0.0.1
fi
if ! which pulseaudio >/dev/null 2>&1; then
echo "ERROR: PulseAudio does not appear to be installed"
exit 1
fi
else
echo "ERROR: Work only in mac"
exit 1
fi
docker run -it \
--rm \
--env="DISPLAY=host.docker.internal:0" \
--env="PULSE_SERVER=host.docker.internal:4713" \
--volume="/tmp/.X11-unix:/tmp/.X11-unix:ro" \
--volume="$(pwd)/.wine:/root/.wine" \
--volume="$(pwd)/sources:/root/sources" \
--volume="$HOME/.config/pulse:/root/.config/pulse" \
--hostname="winecellar" \
--name="wine" \
--privileged \
wine wine notepad.exe