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
    • 最新
    • 标签
主页 / unix / 问题 / 790099
Accepted
GTK
GTK
Asked: 2025-01-25 10:36:54 +0800 CST2025-01-25 10:36:54 +0800 CST 2025-01-25 10:36:54 +0800 CST

为什么 xrandr 在镜像显示时不使用 --fb 设置

  • 772

我的办公室里有两台并排的 Ubuntu 显示器。我为不同的显示器配置设置了别名。有时候我想镜像显示器(用于与实验室里的学生讨论),有时候我想让学生使用第二台显示器作为演示设备。

当我在“landscape”或“portrait”之后运行“mirror”别名时,xrandr系统提示屏幕不够大,这是由于之前的设置造成的。如果我先运行“student”别名(这会关闭第二个显示器),那么就可以成功运行“mirror”。

我尝试过很多不同的编辑,但似乎都没有达到预期的效果。我做错了什么xrandr?

这是命令行上的输出。

[~] source ~/src/dotfiles/hosts/gtkoffice_rc 
[~] landscape 
[~] mirror
xrandr: specified screen 1920x1200 not large enough for output DP-2 (1920x1200+1920+0)
xrandr: Configure crtc 1 failed
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  140 (RANDR)
  Minor opcode of failed request:  21 (RRSetCrtcConfig)
  Value in failed request:  0x0
  Serial number of failed request:  54
  Current serial number in output stream:  54
[~] landscape 
[~] student
[~] mirror
[~] 

以下是来自~/src/dotfiles/hosts/gtkoffice_rc

export RIGHT_DISPLAY="DP-2"
export LEFT_DISPLAY="DP-3"
# for editing manuscripts
alias portrait='xrandr --fb 3120x1920  --output $LEFT_DISPLAY --mode 1920x1200 --panning 1920x1200+0+0 --output $RIGHT_DISPLAY --mode 1920x1200 --panning  1200x1920+1920+0 --rotate left'
# for normal work
alias landscape='xrandr --fb  3840x1200 --output $LEFT_DISPLAY --mode 1920x1200 --panning 1920x1200+0+0 --output $RIGHT_DISPLAY --mode 1920x1200 --panning 1920x1200+1920+0 --rotate normal'
# for discussions
alias mirror='xrandr --fb 1920x1200 --output $LEFT_DISPLAY --mode 1920x1200 --panning 1920x1200+0+0 --output $RIGHT_DISPLAY --mode 1920x1200 --panning 1920x1200+0+0 --rotate normal'
# student using 2nd monitor
alias student='xrandr --fb 1920x1200 --output $LEFT_DISPLAY --mode 1920x1200 --panning 1920x1200+0+0 --output $RIGHT_DISPLAY --off'
xrandr
  • 1 1 个回答
  • 23 Views

1 个回答

  • Voted
  1. Best Answer
    Robert Siemer
    2025-04-15T11:35:31+08:002025-04-15T11:35:31+08:00

    替换--panning 1920x1080+0+0为--pos 0x0等。

    我以前见过这种情况,但我不知道为什么滥用这个--panning选项会这么流行。如果你不想使用平移功能(看起来你确实不想),那就干脆不要用平移选项!

    要将显示器定位在 X11 屏幕上,请使用--pos。

    • 1

相关问题

  • xrandr:配置 crtc 失败

  • 在双显示器上校准触摸屏(一触一非)

  • 试图避免显示损坏的 Xrandr 问题

  • Intel-virtual-output - 高温导致 Linux 崩溃

  • 旋转网络摄像头和屏幕(纵向模式)

Sidebar

Stats

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

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

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

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve