There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

Tool for easily creating custom Xorg resolutions?

Creating custom resolutions is quite tedious. Surely I can’t be the first person to desire a tool which just does it for me.

Enter x, y, rate and done. That’s what I want. Quick feedback cycles. No running 3 commands manually specifying names or whatever; I don’t care how it’s called, I don’t want to have to specify.

Does it exist? Preferably CLI or TUI but I could live with GUI.

Shareni ,
Atemu OP ,
@Atemu@lemmy.ml avatar

That tool does not claim to support custom resolutions in any way.

vvv ,

I have a stupid little script for this:


<span style="color:#323232;">#!/bin/sh
</span><span style="color:#323232;">
</span><span style="color:#323232;">setres() {
</span><span style="color:#323232;">  output=$1
</span><span style="color:#323232;">  width=$2
</span><span style="color:#323232;">  height=$3
</span><span style="color:#323232;">
</span><span style="color:#323232;">  xrandr --output $output --brightness 0 --auto
</span><span style="color:#323232;">  xrandr --delmode $output better
</span><span style="color:#323232;">  xrandr --rmmode better
</span><span style="color:#323232;">
</span><span style="color:#323232;">  xrandr --newmode better $(cvt $width $height | tail -n1 | cut -d'"' -f3)
</span><span style="color:#323232;">  xrandr --addmode $output better
</span><span style="color:#323232;">  xrandr --output $output --brightness 1 --mode better 
</span><span style="color:#323232;">}
</span><span style="color:#323232;">
</span><span style="color:#323232;">setres "$@"
</span><span style="color:#323232;">
</span>
madnificent ,

Nice script. What is the reason to toggle the brightness?

vvv ,

I didn’t like the random blinking and glitchiness the screen did as it changed resolutions. Most OSes, if you notice, do a little fade out and in but I was too lazy to make it gradual.

MonkderZweite ,

Putting it in a function and the setres “$@” bit is superfluous here.

vvv ,

Eh, though you’re right, it’s a pattern I like a lot: define your “main” at the top, put all the supporting functions below, and call main at the end.

These days I’ve got a little bash task runner framework that I use for little scripts like this.

D_Air1 ,
@D_Air1@lemmy.ml avatar

Funny thing about this. I had always though that creating new resolutions didn’t work because I would always encounter an error no matter what guide I followed. It wasn’t until a month ago that I discovered that the new resolution thing with xrandr doesn’t work on nvidia.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines