forked from iped-docker/iped
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdkr.source
More file actions
34 lines (31 loc) · 876 Bytes
/
Copy pathdkr.source
File metadata and controls
34 lines (31 loc) · 876 Bytes
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
#!/bin/bash
dkr ()
{
xhost + > /dev/null 2>&1
# Resolve a treta do X11 no WSLg vs Linux Nativo
if [ -d "/mnt/wslg/.X11-unix" ]; then
X11_SOCKET="/mnt/wslg/.X11-unix"
else
X11_SOCKET="/tmp/.X11-unix"
fi
# Só injeta os devices de vídeo/áudio se eles existirem no host
DEVICES=""
if [ -e "/dev/dri" ]; then
DEVICES="$DEVICES --device /dev/dri"
fi
if [ -e "/dev/snd" ]; then
DEVICES="$DEVICES --device /dev/snd"
fi
docker run --gpus all --rm -it -v "`pwd`":"`pwd`":Z \
-e DISPLAY=$DISPLAY -e GDK_BACKEND \
-e GDK_SCALE \
-e GDK_DPI_SCALE \
-e QT_DEVICE_PIXEL_RATIO \
-e LANG=C.UTF-8 \
-e LC_ALL=C.UTF-8 \
-e NO_AT_BRIDGE=1 \
$DEVICES \
-v /etc/localtime:/etc/localtime:ro \
-v $X11_SOCKET:/tmp/.X11-unix "$@"
}
export -f dkr