i3status-rust icon indicating copy to clipboard operation
i3status-rust copied to clipboard

xrandr frame rates?

Open lilygruman opened this issue 1 year ago • 0 comments

I am interested in having frame rate information in the xrandr block. I personally find myself interacting with xrandr most when fighting with my monitors' frame rates, so it would be very useful to have information about it alongside the resolution.

I couldn't find any existing issues or PRs regarding frame rates, so I am curious if there is any interest in adding it in the future. I am willing to take a stab at it myself if this hasn't been considered or tried and rejected already.

From what I can tell the parsing would be somewhat more complicated, since it is spread across multiple lines:

  2560x1440 (0x1d6) 296.000MHz +HSync -VSync *current
        h: width  2560 start 2568 end 2600 total 2666 skew    0 clock 111.03KHz
        v: height 1440 start 1443 end 1448 total 1481           clock  74.97Hz

I believe it would just be a matter of grabbing the *current markers and the v: lines, then using the v: line immediately following the *current marker and matching that with the right output.

Alternatively, just use the xrandr --query output:

HDMI-0 connected 2560x1440+2560+0 (normal left inverted right x axis y axis) 597mm x 336mm
   2560x1440     59.95 +  74.97*

and find the *, though that would have to be separate from the brightness retrieval.

Has this been considered previously? If not, is there interest?

lilygruman avatar Jul 31 '24 03:07 lilygruman