-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvd
executable file
·76 lines (67 loc) · 1.7 KB
/
vd
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
#
# Modified by wost 2021-08-20
#
vd_home=`pwd`
docker_image=forthev/vd:latest
# os_type=`uname`
# if [ "$os_type" == "Darwin" ]; then
# for i in en0 en1 en2 en3 en4 en5 en6 en7 en8; do
# ip_addr=${ip_addr:-`/sbin/ifconfig $i | sed -ne '/inet/ s/.*inet \([0-9.]*\).*/\\1/p'`}
# done
# else
# for i in wlp1s0 enp0s31f6 enp5s0 eth0 eth1 eth2 wlan0 wlan1 wlan2 ens33; do
# ip_addr=${ip_addr:-`/sbin/ip addr show $i | sed -ne '/inet/ s/.*inet \([0-9.]*\).*/\\1/p'`}
# done
# fi
if [ -z "$1" ]
then
echo "Usage: $0 [command]"
echo
echo "command can be:"
echo
echo " - clone Vierte Dimension repository to current directory:"
echo ' fossil clone https://$USER@fossil.forth-ev.de/vd-JJJJ-0x vd-JJJJ-0x.fossil'
echo
echo " - expand fossil repository to current directory:"
echo " fossil open vd-JJJJ-0x.fossil"
echo
echo " - other fossil command"
echo
echo " - typeset Vierte Dimension issue:"
echo " make"
echo
echo " - preview Vierte Dimension issue:"
echo " mupdf 4dJJJJ-0x.pdf"
echo
echo " - run Lyx editor:"
echo " lyx [filename]"
echo
# echo "Graphical applications require an X-Server running at DISPLAY=$ip_addr:0"
echo "Graphical applications require an X-Server running"
echo
exit
fi
set -x
docker run -i -t \
-e USER=$USER \
-e DISPLAY=$DISPLAY \
-p 8080:8080 \
--name docker-vd \
-v /tmp/.X11-unix/:/tmp/.X11-unix/ \
-v "$vd_home":/VierteDimension \
-v /dev/dri:/dev/dri -v $XAUTHORITY:/tmp/.Xauthority \
--rm \
$docker_image $*
# Original:
# =========
#
# xhost +
# set -x
# docker run -i -t \
# -e USER=$USER \
# -e DISPLAY=$ip_addr:0 \
# -p 8080:8080 \
# --name docker-vd \
# -v "$vd_home":/VierteDimension --rm $docker_image $*
# xhost -