You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
name: current
outputs:
VGA1:
crtc: 0
mode: 1920x1200
panning: '0x0'
pos: '0x0'
rate: '59.95'
rotate: normal
scale: 1x1
primary: VGA1
Currently, the quotation marks are shown more or less randomly. I'd expect they followed some kind of order, such as:
every parameter value is quoted (currently 4 missing in this case)
only pure numerical values (ints and floats) aren't quoted (currently 4 missing and one redundant in rate)
only strings containing 2D numerical values are quoted (quotes missing in mode and scale, while again being redundant in rate)
no quotes are necessary (currently 3 redundant)
I vote for the last option since quotes aren't necessary to reliably parse such output and they also don't simplify screen reading, actually the opposite.
I know randrctl is currently not actively developed, but I'm still collecting ideas here for anyone that picks it up.
The text was updated successfully, but these errors were encountered:
@drws , thanks for expressing your ideas. Appreciate that.
The quotation is there in some cases because yaml is actually typed (sic!). If string type can be deduced from the content, quotation isn't necessary.
With 0x0 it is not obvious to parser whether it's a hexadecimal number or a string.
Same story with 59.95. We could of course drop quotation and treat it as float, but floats in most languages are expressed following the IEEE-754, meaning that upon parsing we'll have 59.9500000003 or something like that. And in general case we don't know at which point it is safe to trim that number.
randrctl performs some arithmetics only on tuples (2d numerical values), which are specified as strings and require parsing anyway. Hence the correct thing here would be to quote everything, but again this quotation is performed by PyYAML and I'm not even sure it gives any control over that.
Frankly, the better option IMO is to use a different format alltogether (yaml spec is really overly complicated despite its visual simplicity). TOML is a new trendy thing...
I know randrctl is currently not actively developed, but I'm still collecting ideas here for anyone that picks it up.
I've been meddling with a rewrite in a private repo which addresses some of the painful issues of the current implementation. Namely, the new version doesn't require xrandr and can be distributed as a single binary, however it is in the early prototype stage (and it's been like that for more than a year already, as I never have enough time/motivation). That's why I appreciate your attention to this project even more, and perhaps I can find motivation to push the rewrite further.
Thanks!
This is a sample
randrctl show
output:Currently, the quotation marks are shown more or less randomly. I'd expect they followed some kind of order, such as:
rate
)mode
andscale
, while again being redundant inrate
)I vote for the last option since quotes aren't necessary to reliably parse such output and they also don't simplify screen reading, actually the opposite.
I know
randrctl
is currently not actively developed, but I'm still collecting ideas here for anyone that picks it up.The text was updated successfully, but these errors were encountered: