-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.sh.include
36 lines (29 loc) · 1.29 KB
/
common.sh.include
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
# Parse and map ports to users {
CONFIG="/etc/assigned_vncserver_ports.conf"
if [ ! -f ${CONFIG} ]; then
echo "ERROR: ${CONFIG} file not found"
exit 1
fi
LISTENING_PORT=`cat ${CONFIG} | grep -v "^#" | grep $USER | cut -d "=" -f 2`
CONST_BASE_PORT=5900
DISPLAY_NUMBER=$(( $LISTENING_PORT - $CONST_BASE_PORT ))
echo DISPLAY_NUMBER:$DISPLAY_NUMBER
# }
LOG="/tmp/vncserver.${USER}.${LISTENING_PORT}.log"
echo "" > $LOG
echo "Logs redirected to $LOG"
# TYPICAL VALUES FOR GEOMETRY: GEOMETRY:=2560x1440 , 1920x1200, 1920x1080
GEOMETRY=1920x1080
TIGERVNC_SERVER_OPTS=""
TIGERVNC_SERVER_OPTS="$TIGERVNC_SERVER_OPTS -fg :$DISPLAY_NUMBER"
TIGERVNC_SERVER_OPTS="$TIGERVNC_SERVER_OPTS -name $LISTENING_PORT "
TIGERVNC_SERVER_OPTS="$TIGERVNC_SERVER_OPTS -depth 24 "
TIGERVNC_SERVER_OPTS="$TIGERVNC_SERVER_OPTS -dpi 96 " # Change to 192 or higher for 4K displays
TIGERVNC_SERVER_OPTS="$TIGERVNC_SERVER_OPTS -geometry ${GEOMETRY} "
# TIGERVNC_SERVER_OPTS="$TIGERVNC_SERVER_OPTS -nevershared"
# TIGERVNC_SERVER_OPTS="$TIGERVNC_SERVER_OPTS -ac" # disable access control restrictions
# TIGERVNC_SERVER_OPTS="$TIGERVNC_SERVER_OPTS -audit 3" # audit level
# TIGERVNC_SERVER_OPTS="$TIGERVNC_SERVER_OPTS -verbose 3"
if [ ! -d ${HOME}/.vnc ] ; then mkdir ${HOME}/.vnc ; fi
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS