Closed mfs closed 4 years ago
That is indeed a hack.
I don't even have ~/.local, so for starters you should have used XDG environment variables.
And I don't have anything in XDG_DATA_HOME/xorg
And you could have removed
resolution=${resolution##*initial mode }
and set resolution to that when it was first set (instead of resolution=$line; break)
Also I forgot to mention this somehow, but this would also break multi-monitor setups.
Xorg would display it was the combined width/height of all of the monitors, as that's how Xorg works.
Yeah, this might be a bit of a stretch for sh. :) Maybe a generic way of displaying content from an env variable that could be set externally e.g in xinitrc. Feels like a bit of a cheat though.
This is a really neat script.
Was wondering if there was a way to display resolution while staying POSIX sh only. This is the best I could come up with so far. May not work on all versions of xorg/configurations and could break in other ways. Perhaps someone could come up with something better. :)
https://github.com/mfs/fet.sh/tree/resolution-hack