Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DPI settings? #109

Open
SuperFluffy opened this issue Mar 5, 2015 · 9 comments
Open

DPI settings? #109

SuperFluffy opened this issue Mar 5, 2015 · 9 comments

Comments

@SuperFluffy
Copy link

Is there a way to teach bar to use my system's native DPI (213)? I have set that value in /etc/X11/xorg.conf.d, and also for the Xft.dpi setting in .Xresources (although that one most likely isn't touched by bar). Everything is scaling rather nicely, except that bar is really really tiny (and the font terminus is already set to size 16).

@LemonBoy
Copy link
Owner

I guess the bar should stretch or do something like that, summoning @jvvv for ideas

@jvvv
Copy link
Contributor

jvvv commented Mar 14, 2015

I'll do some investigating. Last time I looked into parsing the X Resource Database stuff, there was no direct support. Maybe there is some progress on it somewhere. When I did a port of 9wm to xcb, I was interested in this for an eventual port I had intended to do of larswm to xcb... this was a big part of the reason I put it on the back burner. It will be interesting to see if there has been any new developments. Give me some time to do some digging. Either way, I will look into coming up with something useful for resolution values, etc.

@jvvv
Copy link
Contributor

jvvv commented Mar 16, 2015

Ok, I did some initial poking around. Getting data from X Resource Database would require HUGE amounts of code to implement for pure libxcb based program as we have in lemonbar. Btw, even the xcb maintainers seem to be hesitant to do this; I seem to remember one mailing list post mentioning something about 10 foot poles. The only other way of doing it that I can think of is to use the Xrm* libX11 functions... this is not a road I think is worth the travel. I think we would have to use the X11-XCB compat libs and now we have a major rewrite to make the compat stuff to fit. (I may be wrong about this, but that is how I understand things at this time).
I am forming an inkling of an idea about using the dpi to change font size, but would require scalable fonts. This may be doable, though time will tell.

@LemonBoy
Copy link
Owner

Oh, I didn't mean to parse the Xresource at all, the dpi value can be easily calculated from the monitor size and providing a way to override the default dpi value is trivial.
The part that is not very clear to me is how to handle the stretching of the window and the fonts :|

@LemonBoy
Copy link
Owner

Some updates on this, it's just a matter of setting up a proportion between the dimension at 96dpi and the one at Xdpi, so in the end new_size = old_size * new_dpi / 96. Easy peasy.
Since bar spans across the space and time and monitors we need to take into account the different dpi-ness of each monitor.
No rocket science is involved, hence it may (or may not) be done soon :)

@jvvv
Copy link
Contributor

jvvv commented May 27, 2015

I've finally come back to this. Code in PR #128 is ready for testing, critique. Not sure this is exactly what you were talking about, but I'm open to different ways to implement it.

@rubik
Copy link

rubik commented Jun 1, 2016

I've encountered problems on a HiDPI monitor as well.
All problems were solved by switching to https://github.com/krypt-n/bar, which supports Xft fonts. I am aware that the changes in the fork are too many, so it probably will never be merged.
But what about @jvvv changes? I have yet to try them, but it would be great @LemonBoy reviewed them.

@LemonBoy
Copy link
Owner

LemonBoy commented Jun 1, 2016

You can achieve similar results by tweaking the font sizes by hand, which is what more or less the PR you linked to does.

@Popkultur
Copy link

I have no problems on hidpi monitor if I set a dpi in Xorg.conf, Xresources and xrandr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants