Open drws opened 2 years ago
@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.