I’ve got a really cheap laptop. I’ve also got a i7 Lenovo x230 powerhouse. They both have a screen resolution of 1366x768, which I usually don’t mind too much, unless I want to make a screen-cast or take a screenshot of a really detailed logic analyzer capture or something.
Now, I could plug into my 4K TV or 1080p monitor, but getting off the couch just to take a screenshot? No, there’s a better way..
Using xrandr we can “fake” it, telling X to give us whatever resolution we want while “zooming” in or out to make it all fit on our screen. Of course, it looks like crap on the screen, but we can take nice and crisp screenshots or casts as if we had a 1080p or even 4K monitor hooked up.
So, here’s how I get xrandr to give me a “1080p” display:
xrandr --output eDP1 --mode 1366x768 --panning 1920x1080 --scale 1.405x1.406
Note that if your physical resolution is not 1366x768, then you’ll need to adjust this command. Here’s the break down:
Setting it back to normal is also pretty straight forward:
xrandr --output eDP1 --mode 1366x768 --panning 1366x768 --scale 1x1
Here I just set –mode and –panning both to the monitors native resolution and set scale to 1x1, or no scaling. Again, make sure you use your screens native resolution, not mine.
So, all that’s left is to wrap these up in a nice shell script or aliases, but I’ll leave that as an exercise to the reader..