惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
U
Unit 42
GbyAI
GbyAI
M
MIT News - Artificial intelligence
美团技术团队
罗磊的独立博客
雷峰网
雷峰网
量子位
博客园 - 【当耐特】
Last Week in AI
Last Week in AI
D
Docker
小众软件
小众软件
S
SegmentFault 最新的问题
Blog — PlanetScale
Blog — PlanetScale
阮一峰的网络日志
阮一峰的网络日志
宝玉的分享
宝玉的分享
T
Tailwind CSS Blog
WordPress大学
WordPress大学
V
V2EX
博客园_首页
腾讯CDC
The Cloudflare Blog
A
About on SuperTechFans
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC

Danb Blog

August 2026: What I've Been Working On · Danb Blog Great Tech: Intel 2500k CPU · Danb Blog July 2026: What I've Been Working On · Danb Blog My Experience with Ubuntu Desktop 26.04 · Danb Blog Thumbnails for Orca 3MF in GNOME Files · Danb Blog Cheaper Sodastream Gas with a Big Tank · Danb Blog June 2026: What I've Been Working On · Danb Blog Running Snyk On Forgejo/Codeberg Actions · Danb Blog Tuta & Proton: An Open Source Client Does Not Result in an Open Source Service · Danb Blog May 2026: What I've Been Working On · Danb Blog 3D Printing Parts for my Greenhouse, Round 2 · Danb Blog Great Devices: Nexus 7 2013 · Danb Blog R36S Console RetroArch Stuck Menu Issue · Danb Blog April 2026: What I've Been Working On · Danb Blog Basic OpenCode Sandboxing with Docker · Danb Blog Games Played in 2025 · Danb Blog March 2026: What I've Been Working On · Danb Blog Shivam Mathur's "node-docker" Images are Awesome for PHP CI · Danb Blog February 2026: What I've Been Working On · Danb Blog Your BookStackApp project was assigned as a project for my Software Architecture course · Danb Blog My Sovol SV08 3D Printer Setup in 2026 · Danb Blog January 2026: What I've Been Working On · Danb Blog Epson Printer: The administrator password you entered was not recognized · Danb Blog Pressure to Follow Process · Danb Blog Online Shopping Email Notifications · Danb Blog My HomeLab Setup in 2026 · Danb Blog Linux Label Printing with the Phomemo D30 · Danb Blog Reporting to the CMA: Google Android Developer Verification · Danb Blog OPNsense & Dnsmasq: Responding with specific DNS servers · Danb Blog An Impromptu Introduction to ZFS Drive Replacement at 1am · Danb Blog
Scripting Monitors (Gnome & Wayland on Fedora) · Danb Blog
2024-01-20 · via Danb Blog

On my PC (Fedora 39, Gnome Desktop Environment via Wayland) I often find myself switching monitor configuration. I have a dual-4k-screen setup, and jump between a few modes:

  • Normal/Development - Dual screen, both at 175% scale
  • Gaming - Single screen at 100% scale
  • Recording - Dual screen, alternate primary screen, one 2x scale, one 1.2x scale

While not tricky, it’s a fiddly process to frequently configure monitor settings. Therefore I wanted to automate this process. Looking online, most tools and guides used old techniques which were incompatible with my current desktop environment.

Then I came across gnome-monitor-config. After compiling and testing this out, it seemed to do the job! Then I found I didn’t need to compile it myself since it’s already available in the Fedora repos under the “gnome-monitor-config” package, so I just needed a sudo dnf install gnome-monitor-config to get it installed.

Once available, I then wrote a simple bash script with my various configurations:

#!/bin/bash

if [ -z "$1" ]; then
  echo "Setting monitors to default state"
  echo "================================="
  gnome-monitor-config set -LM DP-2 -m 3840x2160@59.997 -x 2192 -y 0 -t normal -s 1.7518248558044434 \
      	   -LpM DP-1 -m 3840x2160@59.997 -x 0 -y 0 -t normal -s 1.7518248558044434
else
  case "$1" in
    "gaming")
      echo "Setting monitors up for gaming"
  	  echo "=============================="
  		gnome-monitor-config set -LpM DP-1 -m 3840x2160@59.997 -x 0 -y 0 -t normal -s 1
      ;;
    "recording")
      echo "Setting monitors for recording"
      echo "=============================="
      gnome-monitor-config set -LpM DP-2 -m 3840x2160@59.997 -x 1920 -y 0 -t normal -s 1.5 \
      	   -LM DP-1 -m 3840x2160@59.997 -x 0 -y 0 -t normal -s 2
      ;;
    *)
      echo "Unknown argument: $1; Valid arguments: gaming, recording (pass nothing for default)"
      ;;
  esac
fi

With this saved to a monitors executable file in my PATH, I can just run monitors gaming to configure things for gaming, monitors recording for recording, or just monitors to return things to my default setup.

Details of the syntax and options can be found in the readme of the gnome-monitor-config repo. The only thing I found fiddly was the x and y positioning. This had to be correct with monitors adjacent, which may not be obvious to work out when scaling is involved. To get correct figures, I found I could configure my monitors as normal via gnome settings, then read my ~/.config/monitors.xml file to understand the values gnome uses and accepts.

This has seemed to work pretty well so far. I sometimes see some rendering noise/artifacts after switching, but not always and it goes away in seconds.