我發現自己擁有這樣一款普通的平板電腦,感測器無法正常工作(我的大兒子已經盡力了),我花了很長時間思考如何調整它。 谷歌搜索,谷歌搜索和谷歌搜索(
你將需要:
Linux 已安裝:
- x11vnc (坦白說我不喜歡各種 TigerVNC 和其他)
- 亞行 來自 android-tools 套件
啟用調試模式並設定為的平板電腦/智慧型手機:
- Android雷士 (我有這個,因為沒有廣告)
- 某種螢幕消隱攔截器(我找不到沒有廣告的攔截器)
- 任何自動載入器(運行 VNC 和阻止程式)都是可選的(更多內容請見下文)。
好的,我們開始吧。
1. 取得 xorg.conf 的 Modeline
$ cvt 1024 768 25 # Можно и gtf, но он не всегда дает корректный modeline.
2. 編輯
配置文件
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
我們重新啟動X-sys並通過arandr進行檢查。 設定位置和方向。它應該看起來像這樣:
我們將其保存到文件中 - 這對我們很有用。
3.建立一個在WM/DE中自動載入的檔案(我有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
讓我們檢查:
$ xrandr |grep VIRTUAL1
VIRTUAL1 connected 1024x768+1600+0 (normal left inverted right x axis y axis) 0mm x 0mm
由於 IceWM 中沒有自動啟動目錄,但有一個檔案 ~/.icewm/startup (應該是可執行的),因此在其中添加以下內容:
sh -c /path/to/planshet.sh
4. 停用監視器消隱:
xset s off
xset s noblank
xset -dpms
有趣的來了! 如何在不使用“試錯法”的情況下通過折磨控制台中的鍵盤來獲取設備的“點擊”坐標?!
為了這樣的事情我雕刻了
6. 讓我們將所有這些加入到 planshet.sh 中
完整版
#!/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 предварительно прописав адрес и порт
我們會做到的
chmod +x /path/to/planshet.sh
事實上,僅此而已。 重新啟動 X 伺服器並獲得多螢幕。
我的“小”機器上有 Conky 運行。
附上雙螢幕的截圖。
當我建模時,我也會將資料表丟到上面。
來源: www.habr.com