Essendomi trovato proprietario di un tablet così mediocre con un sensore non funzionante (mio figlio maggiore ha fatto del suo meglio), ho pensato a lungo a dove adattarlo. Cercato su Google, cercato su Google e cercato su Google (
Il mio metodo è sotto il taglio.
Avrete bisogno di:
Linux con installato:
- x11vnc (Francamente non mi piacciono tutti i tipi di Tigervnc e altri)
- adb dal kit degli strumenti Android
Tablet/smart con modalità debug abilitata e impostata su:
- AndroidNVC (Ho questo, perché non ci sono pubblicità)
- Una sorta di blocco dell'oscuramento dello schermo (non sono riuscito a trovarne uno senza pubblicità)
- Qualsiasi caricatore automatico (esegui VNC e blocco) è facoltativo (ne parleremo più avanti).
ok iniziamo.
1. Ottieni Modeline per xorg.conf
$ cvt 1024 768 25 # Можно и gtf, но он не всегда дает корректный modeline.
2. Modifica
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
Riavviamo l'X-sys e controlliamo tramite arandr. Imposta la posizione e l'orientamento. Dovrebbe assomigliare a questo:
Lo salviamo in un file: ci sarà utile.
3. Crea un file per il caricamento automatico in WM/DE (ho 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
Dai un'occhiata:
$ xrandr |grep VIRTUAL1
VIRTUAL1 connected 1024x768+1600+0 (normal left inverted right x axis y axis) 0mm x 0mm
Poiché in IceWM non esiste una directory di avvio automatico, ma è presente un file ~/.icewm/startup (che dovrebbe essere eseguibile), aggiungivi quanto segue:
sh -c /path/to/planshet.sh
4. Disabilitare l'oscuramento del monitor:
xset s off
xset s noblank
xset -dpms
Ora arriva la parte divertente! Come ottenere le coordinate "tocco" per un dispositivo senza il "metodo di prova ed errore" torturando la tastiera nella console?!
Per il bene di una cosa del genere ho scolpito
6. Aggiungiamo tutto questo a planshet.sh
Versione completa
#!/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 предварительно прописав адрес и порт
E lo faremo
chmod +x /path/to/planshet.sh
Questo è tutto, in realtà. Riavvia il server X e ottieni un multischermo.
Ho Conky in esecuzione sul mio "piccolo".
In allegato uno screenshot del doppio schermo.
Ci inserisco anche delle schede tecniche quando modello qualcosa.
Fonte: habr.com