Ubuntu Desktop20.04更改默認主屏幕


在多屏幕的時候默認的主屏幕可能不是我們想要的那個屏幕,每次再系統重啟后就要手動設置一下Settings - Disaplay - Primary Display ; 雖然這樣子也能更改但明顯就很煩,如果能自動切換那就最好了。
以下為我在網上找到的一些解決方案:

  1. 直接換接口線,將當前默認主屏幕的線跟想要的主屏幕線換一下,這個方案就比較Low了;
  2. 更改 ~/.config/monotor.xml,將Primary從 Yes改成no,這個方法我沒試過,但看起來是可行的;
  3. 使用xrandr來更改默認主屏幕,具體操作如下:
#查看當前主屏幕名稱, Virtual2為主屏幕
$ xrandr --output Virtual2 --primary
Virtual1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
Virtual2 connected primary 1920x1080+1920+0 (normal left inverted right x axis y axis) 0mm x 0mm
Virtual3 connected 1920x1080+3840+0 (normal left inverted right x axis y axis) 0mm x 0mm

#獲取屏幕號
$ xrandr --prop | grep "[^dis]connected" | cut --delimiter=" " -f1
Virtual1
Virtual2
Virtual3

#更改默認主屏幕為Virtual3
$ xrandr --output Virtual3 --primary

為了做到系統啟動就能幫助更新,需要將該命令放在默認啟動中,查找程序 Startup Application Preferences - Add - xrandr --output Virtual3 --primary,這樣子系統啟動后就會默認執行該命令來更新主屏幕。

至此就能達到我們的想要的效果啦,祝Ubuntu使用愉快!


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM