-
Notifications
You must be signed in to change notification settings - Fork 122
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
Handle DPI settings #33
Comments
Couldn't we extract this from the first line (it states effective resolution and physical device size in mm) of each output? |
I just tried. No, that doesn't work, and that it doesn't makes a lot of sense, too, now that I've come to think about it.. What xrandr displays is per-output DPI only, which can be different from the screen's DPI and also isn't alterable (the physical screen size is hard-coded in the EDID, bytes 21 & 22). What I don't think that including a call to What we could do, if you need this, is to integrate a plugin structure that would enable you to do this without maintaining your own fork - I'm thinking of something simple like importing all modules from a plugin directory and calling well-named hooks from those plugins at detection and application time, probably with a mechanism to store custom settings?! |
A plugin structure would be nice, but a more simple approach is probably just looking at autorandr's output, and then call by I can use just But then again (and for other use cases), it would be useful to have information about if the detected setup is already applied, without calling "autorandr -c", which would apply the changes. In the end, I think two lines should be added to the output: "detected: X" and "current: X" (or something similar). Currently I could just use |
If you're fine with configuring this manually, then you can also place a script called Changing autorandr's default output is a good idea. The current output comes from the legacy bash version (not quite, it exits after it has found the "detected" configuration), and I always thought that it is quite useless in its current form, too. For increased backwards compatibility, we could keep it in its current form, but just replace "(detected)" with "(current)" for the currently loaded configuration?! |
Oh yeah, Re backwards compatibility: a change from "(detected)" to "(current)" would then also be not backwards compatible. I think this issue can be closed for now - there's no need to change anything currently. |
Right. But it'd require less changes in existing scripts. (Maybe I'll change this.. if anyone complains this could always be reverted.)
Ok |
👍 |
@blueyed Would you please share your final solutions? I have an internal and external display that differ a lot in dpi. |
A couple of thoughts on DPI from my experience |
I've ported the example DPI hook from my rerandr3 to autorandr scripts: postsave:
postswitch:
|
Turns out that adding |
What would it entail to implement it? |
Using Vladimir's script as a template extract the DPI while storing a profile (using It might actually be a good idea to just store the |
I had a look, but I'm not up to the task. 😞 I'm not a Python developer, but I thought I could find a test and adjust it and then just figure out the code as I went. I wasn't aware that all the code is in a single file without no tests, so I'm just too scared to try it. (Not saying it's bad or anything, just that I personally don't want to go in there and muck around without better understanding of Python. 🙇♂️) I think that if someone could add support for non-output specific options (like |
This is an attempt to piggy-back fb and dpi onto the first used output. Not certain whether this has catastrophic drawbacks yet. In any case, the dpi information should probably be obtained from the outputs, as those already have all the necessary information, rather than by parsing the xrandr output a second time. Maybe it'd be an even better idea to go with --fbmm instead of dpi. See #33
Pushed a work in progress version with an early attempt to toy around with this to the |
I've tested dpi branch. It seems to get primary output native dpi correctly, save it and apply on restore to xrandr. |
Very nice project, thank you. |
How does all of this relate to multihead (multiple monitors) with different resolutions/DPIs? I have a laptop (3840x2160) and an ultrawide (3440x1440). |
Sadly X11 only supports a single global DPI. You'll need Wayland for Display-specific DPI settings. |
I'd like to (re)store any DPI settings, which I currently set via
xrandr --dpi 120
.This results in these changes in the output from
xdpyinfo
(from 96 to 120):This does not appear to be reflected in the output of
xrandr -q --verbose
.I am using xsettings now (instead of
gnome-settings-daemon), and a script to automatically set it there via
xdpyinfo
(source).However,
xdpyinfo
for my laptop display (Lenovo X220t) is not correct, andtherefore I set it manually.
It would be nice if this could be set per display, but apparently it's per X display (screen).
(The real DPI is 125, but I've read that you should stick to certain factors
from the default of 96 (a factor of 1.25 in this case))
The text was updated successfully, but these errors were encountered: