aboutsummaryrefslogtreecommitdiff
path: root/intellij-idea/run
diff options
context:
space:
mode:
Diffstat (limited to 'intellij-idea/run')
-rwxr-xr-xintellij-idea/run28
1 files changed, 0 insertions, 28 deletions
diff --git a/intellij-idea/run b/intellij-idea/run
deleted file mode 100755
index 9b8a576..0000000
--- a/intellij-idea/run
+++ /dev/null
@@ -1,28 +0,0 @@
1#!/bin/bash
2
3if [ -z "$DISPLAY" ]; then
4 echo "\$DISPLAY is not set"
5 DISPLAYS=( $(netstat -lnt | awk '/127.0.0.1:60/ { split($4,a,":"); print "localhost:" substr(a[2],3) ".0" }') )
6
7 if [ "${#DISPLAYS[@]}" = 0 ]; then
8 echo "No X11 ports available"
9 exit 1
10 fi
11
12 if [ "${#DISPLAYS[@]}" > 1 ]; then
13 echo "More than 1 X11 port available. Which one do you want?"
14 for i in "${DISPLAYS[@]}"; do
15 echo "export DISPLAY=\"$i\""
16 done
17 exit 1
18 else
19 export DISPLAY="${DISPLAYS[0]}"
20 fi
21fi
22
23docker run -ti --rm --net=host \
24 -e DISPLAY \
25 -e XAUTHORITY=$HOME/.Xauthority \
26 -v /usr/share/zoneinfo/America/Los_Angeles:/etc/localtime:ro \
27 -v $HOME:$HOME \
28 intellij-idea "$@"