備忘錄_20160105(定位) 修改 回首頁

程式 2025-02-25 10:09:37 1740449377 100
設定 raspberry pi 5 在沒有接上實體螢幕的前提下,仍有 1920x1080 的解析度讓 vnc 使用

設定 raspberry pi 5 在沒有接上實體螢幕的前提下,仍有 1920x1080 的解析度讓 vnc 使用


偏好設定→Raspberry Pi 設定→Display→Headless Resolution→1920x1080→確定

另外,要 sudo geany /boot/firmware/config.txt
新增底下幾行並儲存

hdmi_force_hotplus=1
hdmi_group=1
hdmi_mode=16
hdmi_drive=2

然後重新開機,就可以用了。

------

假如上面這樣設定,還是不夠的話。
sudo geany /etc/X11/xorg.conf.d/99-vnc-resolution.conf

新增下面幾行,並儲存

Section "Screen"
    Identifier "Screen0"
    Device "DummyDevice"
    Monitor "Monitor0"
    DefaultDepth 24
    SubSection "Display"
        Depth 24
        Modes "1920x1080"
    EndSubSection
EndSection
然後重新開機,就可以用了。

------

假如還不行,那麼。

sudo apt install wmctrl -y

sudo geany ~/.xprofile
  加入下面一行
  wmctrl -r :ACTIVE: -b add,maximized_vert,maximized_horz

重新開機

------

最新實驗的感覺,上面的方法好像有效,又好像無效
冷開機後,無效,但在 sudo reboot 後,又好了!!!