După ce m-am găsit proprietarul unei astfel de tablete obișnuite cu un senzor care nu funcționează (fiul meu cel mare a făcut tot posibilul), m-am gândit mult timp unde să o adaptez. Googled, Googled and Googled (
Veți avea nevoie de:
Linux cu instalat:
- x11vnc (Sincer, nu-mi plac tot felul de tigervnc și altele)
- ADB din setul de instrumente Android
Tabletă/inteligentă cu modul de depanare activat și setat la:
- AndroidNVC (Il am pe acesta, pentru ca nu sunt reclame)
- Un fel de blocare a blocării ecranului (nu am putut găsi unul fără publicitate)
- Orice încărcător automat (execuți VNC și blocare) este opțional (mai multe despre asta mai jos).
OK sa incepem.
1. Obțineți Modeline pentru xorg.conf
$ cvt 1024 768 25 # Можно и gtf, но он не всегда дает корректный modeline.
2. Editare
xorg.conf
Section "ServerLayout"
Identifier "Xorg Configured"
Screen 0 "Monitor" 0 0
Screen 2 "Screen2" rightof "Screen0" # "Пустышка для VNC"
Option "Xinerama" "1"
EndSection
#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
# здесь все настройки оборудования, коли таковые есть
#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
#Dummy видеокарта
Section "Device"
Identifier "Device2"
Driver "dummy"
VideoRam 8000
EndSection
#Dummy монитор
Section "Monitor"
Identifier "Monitor2"
Modeline "1024x768@25" 23.77 1024 1056 1144 1176 768 785 789 807 # см. п. 1
EndSection
#Dummy экран
Section "Screen"
Identifier "Screen2"
Device "Device2"
Monitor "Monitor2"
DefaultDepth 24
SubSection "Display"
#разрешение плашета
Modes "1024x768"
Virtual 1024 748
EndSubSection
EndSection
Repornim X-sys și verificăm prin arandr. Configurați locația și orientarea. Ar trebui să arate cam așa:
Îl salvăm într-un fișier - ne va fi util.
3. Creați un fișier pentru încărcare automată în WM/DE (am planshet.sh)
x11vnc -rfbport 5900 -display :0 -dontdisconnect -noxfixes -xdamage -shared -forever -clip 1024x768+1600+0 -scale 1024x768 -bg -cursor X -o /home/$USER/x11vnc.log -repeat
xrandr --addmode VIRTUAL1 1024x768 # необязательно
xrandr --output VIRTUAL1 --mode 1024x768 # необязательно
xrandr --output VIRTUAL2 --off --output HDMI1 --off --output VIRTUAL1 --mode 1024x768 --pos 1602x0 --rotate normal --output DP1 --off --output VGA1 --mode 1600x900 --pos 0x0 --rotate normal #вот эта строка заимствована из сохраненного файла arandr
Sa verificam:
$ xrandr |grep VIRTUAL1
VIRTUAL1 connected 1024x768+1600+0 (normal left inverted right x axis y axis) 0mm x 0mm
Deoarece nu există un director de pornire automată în IceWM, dar există un fișier ~/.icewm/startup (care ar trebui să fie executabil), adăugați următoarele:
sh -c /path/to/planshet.sh
4. Dezactivează eliminarea monitorului:
xset s off
xset s noblank
xset -dpms
Acum vine partea distractivă! Cum să obțineți coordonatele „apăsare” pentru un dispozitiv fără „metoda de încercare și eroare” torturând tastatura din consolă?!
De dragul așa ceva am sculptat
6. Să adăugăm toate acestea la planshet.sh
Versiunea completă
#!/bin/bash
x11vnc -rfbport 5900 -display :0 -dontdisconnect -noxfixes -xdamage -shared -forever -clip 1024x768+1600+0 -scale 1024x768 -bg -cursor X -o /home/$USER/x11vnc.log -repeat
xrandr --addmode VIRTUAL1 1024x768 # необязательно
xrandr --output VIRTUAL1 --mode 1024x768 # необязательно
xrandr --output VIRTUAL2 --off --output HDMI1 --off --output VIRTUAL1 --mode 1024x768 --pos 1602x0 --rotate normal --output DP1 --off --output VGA1 --mode 1600x900 --pos 0x0 --rotate normal #вот эта строка заимствована из сохраненного файла arandr
xset s off
xset s noblank
xset -dpms
adb tcpip 5555
adb connect 192.168.0.14:5555
sudo adb devices
adb shell input tap 1000 20 # тапаем по "квадратикам" в правом верхнем углу (не знаю, как нызавется) - скрин 3
adb shell input tap 392 138 # тапаем по AndroidVNC
adb shell input tap 20 65 # запускаем VNC предварительно прописав адрес и порт
Și o vom face
chmod +x /path/to/planshet.sh
Asta e tot, de fapt. Reporniți serverul X și obțineți un ecran multiplu.
Am conky care rulează pe cel „mic”.
Este atașată o captură de ecran a ecranului dublu.
De asemenea, arunc foi de date pe el când modelez ceva.
Sursa: www.habr.com