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

推荐订阅源

D
Docker
I
InfoQ
L
LangChain Blog
阮一峰的网络日志
阮一峰的网络日志
Y
Y Combinator Blog
博客园_首页
Martin Fowler
Martin Fowler
宝玉的分享
宝玉的分享
A
About on SuperTechFans
Apple Machine Learning Research
Apple Machine Learning Research
Vercel News
Vercel News
T
The Blog of Author Tim Ferriss
C
Check Point Blog
B
Blog RSS Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Engineering at Meta
Engineering at Meta
B
Blog
爱范儿
爱范儿
Stack Overflow Blog
Stack Overflow Blog
aimingoo的专栏
aimingoo的专栏
WordPress大学
WordPress大学
F
Fortinet All Blogs
月光博客
月光博客
GbyAI
GbyAI

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 (KDE on Fedora) · Danb Blog
2025-03-24 · via Danb Blog

Last year I wrote about scripting monitors for my Gnome/Wayland/Fedora environment, and I’ve heavily utilised that script in my day-to-day PC use.

Recently I jumped over to KDE for a change but my prior script was gnome specific and therefore no longer functioned. Luckily KDE has a handy kscreen-doctor utility which has made it easy to adapt my script to work with KDE:

#!/bin/bash
if [ -z "$1" ]; then
  echo "Setting monitors to default state"
  echo "================================="
  kscreen-doctor output.DP-1.mode.3840x2160@60 output.DP-1.scale.2 output.DP-1.primary output.DP-2.mode.3840x2160@60 output.DP-2.scale.2 output.DP-2.enable
else
  case "$1" in
    "gaming")
      echo "Setting monitors up for gaming"
      echo "=============================="
      kscreen-doctor output.DP-1.mode.3840x2160@60 output.DP-1.scale.1 output.DP-1.primary output.DP-2.disable
      ;;
    "recording")
      echo "Setting monitors for recording"
      echo "=============================="
      kscreen-doctor output.DP-1.mode.3840x2160@60 output.DP-1.scale.2 output.DP-2.mode.3840x2160@60 output.DP-2.scale.1.5 output.DP-2.enable output.DP-2.primary
      ;;
    *)
      echo "Unknown argument: $1; Valid arugments: gaming, recording (pass nothing for default)"
      ;;
  esac
fi

As before, with this saved to a monitors executable script 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. I now have this aliased to just m to make switching even quicker.

If it’s not clear by the commands, this is the configuration set for each of the modes:

  • Normal/Development - Dual screen, both at 200% scale
  • Gaming - Single screen at 100% scale
  • Recording - Dual screen, alternate primary screen, one 200% scale, one 150% scale

This script was written and tested on a Fedora 41 system running KDE plasma via Wayland.