-
Notifications
You must be signed in to change notification settings - Fork 60
/
vncserver-start
52 lines (48 loc) · 1.15 KB
/
vncserver-start
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
#!/bin/bash
export USER=$(whoami)
HEIGHT=0
WIDTH=0
CHOICE_HEIGHT=5
BACKTITLE="AndroNix vncserver resolution selection"
TITLE="vncserver-start"
MENU="Choose one of the following options:"
export PORT=1
OPTIONS=(1 "Start vncserver with autodetect/dynamic resolution"
2 "Start vncserver with QHD resolution"
3 "Start vncserver with FHD resolution"
4 "Start vncserver with HD-ready resolution"
5 "Start vncserver with custom resolution and port")
CHOICE=$(dialog --clear \
--backtitle "$BACKTITLE" \
--title "$TITLE" \
--menu "$MENU" \
$HEIGHT $WIDTH $CHOICE_HEIGHT \
"${OPTIONS[@]}" \
2>&1 >/dev/tty)
clear
case $CHOICE in
1)
echo "You chose dynamic resolution"
GEO="" vnc
;;
2)
echo "You chose QHD resolution"
GEO="-geometry 2560x1440" vnc
;;
3)
echo "You chose Full HD resolution"
GEO="-geometry 1920x1080" vnc
;;
4)
echo "You chose HD-ready resolution"
GEO="-geometry 1280x720" vnc
;;
5)
echo "You chose to manually provide a resolution/port"
echo "Input your custom resolution in format WIDTHxHEIGHT i.e 1920x1200"
read custom
echo "Input your custom port i.e 2"
read port
GEO="-geometry $custom" PORT=$port vnc
;;
esac