forked from Moonwalker316/Chess-Challenge-Better-UI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·31 lines (25 loc) · 786 Bytes
/
run.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
#!/bin/bash -e
if grep -q 'Arch' /etc/os-release; then
unset DBUS_SESSION_BUS_ADDRESS
fi
if [ -z "$WAYLAND_DISPLAY" ]; then
CRI_OPT+=(
--network host
-e XAUTHORITY=/app/.Xauthority
-v "$XAUTHORITY:/app/.Xauthority:ro"
)
fi
CRI="$(command -v podman || command -v docker)"
if ! "${CRI[@]}" image ls &>/dev/null; then
CRI=(sudo "${CRI[@]}")
fi
"${CRI[@]}" build . -t chess
"${CRI[@]}" run --rm --name chess \
"${CRI_OPT[@]}" \
--device /dev/dri/ \
-e DISPLAY \
-e XDG_RUNTIME_DIR \
-v /dev/shm/:/dev/shm/ \
-v /tmp/.X11-unix/:/tmp/.X11-unix/ \
-v "$XDG_RUNTIME_DIR:$XDG_RUNTIME_DIR" \
chess