Learn Docker With My Newest Course

Dive into Docker takes you from "What is Docker?" to confidently applying Docker to your own projects. It's packed with best practices and examples. Start Learning Docker →

Instantly Scale Your Monitors with niri

instantly-scale-your-monitors-with-niri.jpg

This will work with 1 or multiple monitors, it allows you to adjust the zoom level without switching your resolution.

Quick Jump:

Since I have a 4k monitor that I normally run at 100% scale, I often set it to 300% when recording videos so the font size is bigger. It also comes in handy when doing screensharing with clients where I often need to bump it to 200% so folks with lower resolutions can read things clearly.

I really like that the scale switches without adjusting your monitor’s resolution. Switching your resolution often takes a few seconds and can make text look blurry or worse when you’re not running your monitor’s native resolution. With scaling it’s fast and crystal clear.

I’ve been using computers for over 25 years with glasses and I’ve never had to use a specialized magnify tool to zoom into a small section of the screen. Output scaling has solved all of my problems, and occasionally for websites that have very small text on the 4k monitor I’ll use the browser’s zoom feature without scaling the whole display.

# The Script

The script is a standalone shell script which you can find in the DotFriedRice project. It supports multiple monitors by scaling the current / active monitor where you run the script.

Once it’s on your path you can run this from a terminal on the monitor you want to scale:

output-scale    # Cycle between supported scales (1, 1.25, 1.5, 2, etc.)
output-scale 2  # Set the current scale to 2 (zoom in)
output-scale +  # Scale up in 0.25 increments
output-scale -  # Scale down in 0.25 increments

I have it assigned to a few niri key binds to make it even easier:

Mod+Ctrl+Shift+Equal hotkey-overlay-title="Increase focused monitor scale" { spawn "output-scale" "+"; }
Mod+Ctrl+Shift+Minus hotkey-overlay-title="Decrease focused monitor scale" { spawn "output-scale" "-"; }
Mod+Ctrl+Shift+0     hotkey-overlay-title="Reset focused monitor scale" { spawn "output-scale" "1.0"; }

The video below shows it in action.

# Demo Video

Timestamps

  • 0:36 – How to call the script
  • 1:42 – It doesn’t adjust your monitor’s resolution
  • 1:56 – The niri key binds
  • 2:29 – Multi-monitor support

How do you zoom in and out in your displays? Let me know below.

Never Miss a Tip, Trick or Tutorial

Like you, I'm super protective of my inbox, so don't worry about getting spammed. You can expect a few emails per year (at most), and you can 1-click unsubscribe at any time. See what else you'll get too.



Comments