AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 702002
Accepted
sds
sds
Asked: 2015-11-25 06:40:55 +0800 CST2015-11-25 06:40:55 +0800 CST 2015-11-25 06:40:55 +0800 CST

恢复多个显示器设置

  • 772

这是上一个问题(保存监视器设置?)的后续问题,我们在该问题中了解到配置保存在文件中~/.config/monitors.xml。

我的问题是我的配置通常会恢复,但并不总是如此。即,当我开始工作时,我经常不得不调用显示 capplet 来重新配置 3 个显示器。这很乏味,我想避免这种情况。

我可以保存monitors.xml文件,这样即使 ubuntu 覆盖它我也可以恢复它。但是,问题是:如何告诉 ubuntu读取文件?我不想注销或重启。

PS。System76 Gazelle Pro,Ubuntu 15.10,Unity。

聚苯乙烯。配置是:

  <configuration>
      <clone>no</clone>
      <output name="eDP1">
          <vendor>CMN</vendor>
          <product>0x15bb</product>
          <serial>0x00000000</serial>
          <width>1920</width>
          <height>1080</height>
          <rate>60</rate>
          <x>1080</x>
          <y>0</y>
          <rotation>normal</rotation>
          <reflect_x>no</reflect_x>
          <reflect_y>no</reflect_y>
          <primary>yes</primary>
      </output>
      <output name="HDMI1">
          <vendor>DEL</vendor>
          <product>0xa07a</product>
          <serial>0x354c3553</serial>
          <width>1920</width>
          <height>1200</height>
          <rate>60</rate>
          <x>3000</x>
          <y>0</y>
          <rotation>left</rotation>
          <reflect_x>no</reflect_x>
          <reflect_y>no</reflect_y>
          <primary>no</primary>
      </output>
      <output name="VGA1">
          <vendor>DEL</vendor>
          <product>0x4071</product>
          <serial>0x414b314c</serial>
          <width>1920</width>
          <height>1080</height>
          <rate>60</rate>
          <x>0</x>
          <y>0</y>
          <rotation>left</rotation>
          <reflect_x>no</reflect_x>
          <reflect_y>no</reflect_y>
          <primary>no</primary>
      </output>
      <output name="VIRTUAL1">
      </output>
  </configuration>

PPPS。xrandr 输出:

$ xrandr
Screen 0: minimum 8 x 8, current 4200 x 1920, maximum 32767 x 32767
eDP1 connected primary 1920x1080+1080+0 (normal left inverted right x axis y axis) 344mm x 194mm
   1920x1080     60.01*+  59.93  
   1680x1050     59.95    59.88  
   1600x1024     60.17  
   1400x1050     59.98  
   1600x900      60.00  
   1280x1024     60.02  
   1440x900      59.89  
   1280x960      60.00  
   1368x768      60.00  
   1360x768      59.80    59.96  
   1152x864      60.00  
   1280x720      60.00  
   1024x768      60.00  
   1024x576      60.00  
   960x540       60.00  
   800x600       60.32    56.25  
   864x486       60.00  
   640x480       59.94  
   720x405       60.00  
   640x360       60.00  
HDMI1 connected 1200x1920+3000+0 left (normal left inverted right x axis y axis) 518mm x 324mm
   1920x1200     59.95*+
   1920x1080     60.00  
   1600x1200     60.00  
   1680x1050     59.88  
   1280x1024     60.02  
   1280x960      60.00  
   1024x768      60.00  
   800x600       60.32  
   640x480       60.00  
   720x400       70.08  
VGA1 connected 1080x1920+0+0 left (normal left inverted right x axis y axis) 510mm x 287mm
   1920x1080     60.00*+
   1280x1024     75.02    60.02  
   1152x864      75.00  
   1024x768      75.08    60.00  
   800x600       75.00    60.32  
   640x480       75.00    60.00  
   720x400       70.08  
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
multiple-monitors
  • 1 1 个回答
  • 746 Views

1 个回答

  • Voted
  1. Best Answer
    Jacob Vlijm
    2015-11-25T08:21:42+08:002015-11-25T08:21:42+08:00

    假设您不必更改显示器分辨率(如果是这样,只需提及它),并且您的设置存在于从左到右排列它们,(相当长:))命令:

    xrandr --output VGA1 --pos 0x0  --rotate left &&\
    xrandr --output eDP1 --pos 1080x0 --rotate normal &&\
    xrandr --output HDMI1 --pos 3000x0 --rotate left
    

    应该创建你想要的安排。

    解释:

    从 的输出中xrandr,对于每个屏幕,都有一个字符串,如下所示:

    VGA-1 connected 1280x1024+1680+0
    

    这为我们提供了屏幕在“整体画面”中的位置信息,如此处所述。随后,您可以通过以下命令排列屏幕:

    xrandr --output <screenname> --pos <xxy> 
    

    并旋转:

    xrandr --output <screenname> --rotate left
    

    对于三个屏幕中的两个。对于--rotate normal屏幕 1 应该不是必需的,但要确保......

    就像在(这个)答案的命令中使用的一样。

    重要的提示

    如果您这样设置,请务必从左到右设置屏幕,这意味着命令需要按该顺序排列。

    将命令添加到快捷键

    为方便起见,您可以将命令添加到快捷键:选择:系统设置>“键盘”>“快捷方式”>“自定义快捷方式”。单击“+”并添加命令:

    /bin/bash -c "xrandr --output VGA1 --pos 0x0  --rotate left && xrandr --output eDP1 --pos 1080x0 --rotate normal && xrandr --output HDMI1 --pos 3000x0 --rotate left"
    

    到一条捷径。

    • 2

相关问题

  • 如何设置一纵一横两屏?

  • gnome-mplayer 使用 xineramascreen 选项在第二个屏幕上播放

  • 使用带有两屏设置的 Ubuntu

  • 自 10.04 起,笔记本电脑的扩展显示器显示摇晃/波动的图像 [关闭]

  • 有没有办法在 Ubuntu a la Windows 中拥有扩展桌面?[关闭]

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve