this post was submitted on 15 Mar 2024
15 points (85.7% liked)

Linux

48372 readers
1271 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

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.

top 8 comments
sorted by: hot top controversial new old
[–] [email protected] 9 points 8 months ago (2 children)

I have a stupid little script for this:

#!/bin/sh

setres() {
  output=$1
  width=$2
  height=$3

  xrandr --output $output --brightness 0 --auto
  xrandr --delmode $output better
  xrandr --rmmode better

  xrandr --newmode better $(cvt $width $height | tail -n1 | cut -d'"' -f3)
  xrandr --addmode $output better
  xrandr --output $output --brightness 1 --mode better 
}

setres "$@"

[–] [email protected] 4 points 8 months ago (1 children)

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

[–] [email protected] 5 points 8 months ago

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.

[–] madnificent 3 points 8 months ago (1 children)

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

[–] [email protected] 2 points 8 months ago

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.

[–] [email protected] 4 points 8 months ago (1 children)
[–] [email protected] 1 points 8 months ago

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

[–] [email protected] 1 points 8 months ago* (last edited 8 months ago)

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.