This repository was archived by the owner on Jun 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathvnc-android
More file actions
executable file
·54 lines (41 loc) · 1.35 KB
/
vnc-android
File metadata and controls
executable file
·54 lines (41 loc) · 1.35 KB
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
#!/bin/bash
# ### Dependencies : ###
# x11vnc (vnc server)
# android-tools (adb, to make an usb connection between the android device and the computer)
# libnotify (to allow notifications, because it's the only way to see that the chaos is done)
internal="eDP1"
screen1="2048x1152"
virtual1="1920x1200"
if [ -e /usr/share/X11/xorg.conf.d/20-intel.conf ]; then
if [[ $1 == "stop" ]]; then
adb reverse --remove-all
killall x11vnc
sleep 3
echo "Starting chaos"
xrandr --output VIRTUAL1 --off
# This usually does not work on the first time,
# but works like a charm second time
xrandr --output VIRTUAL1 --off
xrandr
xrandr --delmode VIRTUAL1 "$virtual1"
xrandr --output "$internal" --primary --mode "$screen1"
xrandr
sleep 3
notify-send "You can touch your computer without any fear, this is done"
exit 0;
else
xrandr --addmode VIRTUAL1 "$virtual1"
#sleep 3s
xrandr --output VIRTUAL1 --mode "$virtual1" --left-of "$internal"
#sleep 3s
xrandr
sleep 3s
adb reverse tcp:5900 tcp:5900
x11vnc -clip "$virtual1"+0+0 -localhost -multiptr
echo "Done"
fi;
else
echo -e "Section \"Device\"\n Identifier \"intelgpu0\"\n Driver \"intel\"\n Option \"VirtualHeads\" \"2\"\nEndSection" > /usr/share/X11/xorg.conf.d/20-intel.conf
echo "[vdl-monitor] You must reboot or relogin current session to finish setup"
sleep 10s
fi;