grml-resolution: Quick 'n dirty xrandr output parser fix
authorDarshaka Pathirana <dpat@syn-net.org>
Sun, 27 Nov 2022 12:29:51 +0000 (13:29 +0100)
committerDarshaka Pathirana <dpat@syn-net.org>
Sun, 27 Nov 2022 13:10:36 +0000 (14:10 +0100)
commitb3825665c6b20c495e6964bc1fa1a23aa0b30ed9
tree0ce2262dcd320baca62bd26901eadea82338dc34
parent168953e791d6fe6dd0203fe1fda085fba33a033d
grml-resolution: Quick 'n dirty xrandr output parser fix

The xrandr output parser of grml-resolution seems to be broken since at
least Grml 2014.11: grml-resolution does not list possible resolutions
but its corresponding refresh rates.

It seems like once upon a time xrandr had a 'size-index' in front of
each resolution. This is not the case anymore and there does not seem to
be an option to add that behaviour back to xrandr.
So, CURRENT_NUM did not receive the 'size-index' of the current
resolution, therefor I dropped that variable which was used to detect if
the user had chosen the current resolution (nothing bad happens if
xrandr sets the current resolution).

We now list the possible resolutions and refresh rates, separated by an
underscore because `dialog` does not like spaces.
xrandr -s works fine with the chosen 'index' from dialog.

Closes: grml/grml-scripts#14
usr_bin/grml-resolution