配置/禁用 Linux 上双显示器的 Fn+LCD/CRT 模式

配置/禁用 Linux 上双显示器的 Fn+LCD/CRT 模式

我已经在 Ubuntu Linux Karmic 9.10 上正确配置了双显示器设置。我使用 Fn+CRT/LCD 键在模式之间切换,但我必须循环切换 5 种模式才能找到我使用的模式。

它循环的模式(每次按下 Fn+CRT/LCD 键一种模式)包括:

  1. 仅限 LCD
  2. 仅限 CRT
  3. 两者皆有,CRT 位于 LCD 之下
  4. 两者皆有,CRT 位于 LCD 右侧
  5. 两者皆镜像

有什么方法可以禁用其中一些模式,这样我就不必在实际使用的两种模式之间循环切换?

我使用的是戴尔 XPS M1330。

答案1

同时,为了解决这个问题,我最终构建了自定义 xrandr 命令来在我使用的模式之间切换,并在我的文档/菜单上为这些 xrandr 命令创建了启动器。

  • 双显示器:xrandr --output LVDS1 --mode 1280x800 --output VGA1 --below LVDS1 --mode 1280x1024
  • 镜面屏幕:xrandr --output LVDS1 --mode 1024x768 --output VGA1 --same-as LVDS1 --mode 1024x768
  • 仅限笔记本电脑屏幕:xrandr --output LVDS1 --mode 1280x800 --output VGA1 --off

如果构建自己的脚本,您可以通过运行xrandr而不使用任何参数来找到您的监视器输出名称(对我来说是 LVDS1 和 VGA1)。man xrandr有助于找出可以用来获得所需布局的选项。

对于我来说,这个解决方法非常有效,省去了解决最初问题的需要。

答案2

答案3

所以,我知道这还不能回答你的问题。我试图找到哪些代码可以循环执行你在问题中提到的 5 种“模式”,这是我目前找到的。

看起来你遇到了一些麻烦。

看来 Fn-F8 键在 dell-wmi.c 中被忽略了 - 每次按下它时我都会看到 /var/log/messages 出现错误: dell-wmi: Unknown key 42 pressed- 所以切换监视器配置的代码没有从那里调用。

在没有插入任何外部 VGA 端口的情况下,当我按下 Fn-F8 时,我在 /var/log/messages 中看到以下内容:

Dec  2 14:27:02 RStops-PBR kernel: [26143.201120] dell-wmi: Unknown key 42 pressed
Dec  2 14:27:02 RStops-PBR kernel: [26143.430158] i2c-adapter i2c-2: unable to read EDID block.
Dec  2 14:27:02 RStops-PBR kernel: [26143.430163] i915 0000:00:02.0: HDMI Type A-1: no EDID data
Dec  2 14:27:02 RStops-PBR kernel: [26143.435023] i2c-adapter i2c-2: unable to read EDID block.
Dec  2 14:27:02 RStops-PBR kernel: [26143.435026] i915 0000:00:02.0: HDMI Type A-1: no EDID data
Dec  2 14:27:02 RStops-PBR kernel: [26143.439499] i2c-adapter i2c-4: unable to read EDID block.
Dec  2 14:27:02 RStops-PBR kernel: [26143.439502] i915 0000:00:02.0: HDMI Type A-2: no EDID data
Dec  2 14:27:02 RStops-PBR kernel: [26143.443954] i2c-adapter i2c-4: unable to read EDID block.
Dec  2 14:27:02 RStops-PBR kernel: [26143.443958] i915 0000:00:02.0: HDMI Type A-2: no EDID data
Dec  2 14:27:02 RStops-PBR kernel: [26143.490877] [drm] TV-25: set mode NTSC 480i 0
Dec  2 14:27:02 RStops-PBR kernel: [26143.632555] [drm] TV-25: set mode NTSC 480i 0
Dec  2 14:27:03 RStops-PBR kernel: [26144.621183] i2c-adapter i2c-2: unable to read EDID block.
Dec  2 14:27:03 RStops-PBR kernel: [26144.621187] i915 0000:00:02.0: HDMI Type A-1: no EDID data
Dec  2 14:27:03 RStops-PBR kernel: [26144.625648] i2c-adapter i2c-2: unable to read EDID block.
Dec  2 14:27:03 RStops-PBR kernel: [26144.625652] i915 0000:00:02.0: HDMI Type A-1: no EDID data
Dec  2 14:27:03 RStops-PBR kernel: [26144.630157] i2c-adapter i2c-4: unable to read EDID block.
Dec  2 14:27:03 RStops-PBR kernel: [26144.630159] i915 0000:00:02.0: HDMI Type A-2: no EDID data
Dec  2 14:27:03 RStops-PBR kernel: [26144.634866] i2c-adapter i2c-4: unable to read EDID block.
Dec  2 14:27:03 RStops-PBR kernel: [26144.634870] i915 0000:00:02.0: HDMI Type A-2: no EDID data
Dec  2 14:27:03 RStops-PBR kernel: [26144.680947] [drm] TV-25: set mode NTSC 480i 0
Dec  2 14:27:04 RStops-PBR kernel: [26144.822361] [drm] TV-25: set mode NTSC 480i 0

之后我看到一些奇怪的 pulseaudio 消息:

Dec  2 14:27:36 RStops-PBR pulseaudio[2436]: ratelimit.c: 1 events suppressed

(请注意,我使用的是 Dell Latitude E6500 笔记本,而不是 XPS M1330)

只要时间允许,我会继续研究这个问题,一旦发现任何问题,我就会发布后续帖子。
-pbr

相关内容