GithubHelp home page GithubHelp logo

Comments (9)

Ventto avatar Ventto commented on July 30, 2024

Hi @dkambersky,
Thanks for the feedback.

The --dpi setting that you can set with xrandr is an indication to applications, it doesn't configure the hardware. So, forcing DPI value with 96x96 will be a workaround.

from mons.

dkambersky avatar dkambersky commented on July 30, 2024

Yeah, I'm aware, though a lot of the applications I use actually take note of it - i3wm, urxvt (hence the huge fonts in the screenshot, among other things). I just don't want it creeping up to ridiculous values, I'm not expecting it to be a DPI scaling silver bullet.

Do you need any more info from me? It might be that the physical dimensions detected are getting smaller, I don't really know what depends on what there.

EDIT: I should probably clarify that the screenshot is of a fullscreen terminal on a 1680*1050 display, the fonts are usually a fraction of the size.

from mons.

Ventto avatar Ventto commented on July 30, 2024

Me neither.

As you said, the DPI increasing happens when you switch monitors, it means performing the -s option and then -o.

While I am investigating, you should use the following command to adjust the DPI value:

xrandr --dpi <value>

Nevertheless, a first workaround would be to run xrandr --dpi 96 or using xdpyinfo directly.

from mons.

dkambersky avatar dkambersky commented on July 30, 2024

Hi, thanks for the fix! However, it's still not working correctly for me, but I suspect that might be a fault of some auto-detection not neccessarily done by mons - my secondary (120dpi) monitor gets detected as 165x166 dpi, and the primary (96dpi) gets detected as 166x166 for some reason - at least it doesn't creep up with every execution anymore.

Would passing the target DPI as a flag to mons be something that's possible? This utility is otherwise awesome, so I'd love to use it in place of my hacky xrandr script, but it's causing some of my most used GUI elements to be ridiculously oversized.

from mons.

Ventto avatar Ventto commented on July 30, 2024

@dkambersky, thanks again for testing.

Could you please give me your monitor size information ?

from mons.

dkambersky avatar dkambersky commented on July 30, 2024

eDP1-1 (laptop, 13.3", 1080p display, I usually use 120dpi on it):

  • Resolution 1920x1080
  • Physical size 294mm x 165mm

HDMI-0 (external, 20", 1680x1050, 96dpi)

  • Resolution 1680x1050
  • Physical size 434mm x 270mm

here's xrandr's output with the monitor plugged in, after mons -e left. In this state xdpyinfo reports a DPI of 166x166 (occasionally 165x166). Switching back to only the laptop's monitor does not change the DPI.

Thanks for looking into this!

from mons.

Ventto avatar Ventto commented on July 30, 2024

The DPI value given by mons is correct but does not fit for applications.
Actually, there is a huge difference between xdpyinfo and xrandr regarding monitor physical sizes.
Information from xrandr are correct.

Sample:

$ xrandr | grep ' connect'
eDP1 connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 344mm x 194mm

$ xdpyinfo | grep '^screen' -A1
screen #0:
  dimensions:    1920x1080 pixels (508x285 millimeters)

Physical sizes:

  • xrandr: 344mm x 194mm (correct)
  • xdpyinfo: 508mm x 285mm

DPI calculation (from xdpyinfo sources):

    /*
     * there are 2.54 centimeters to an inch; so there are 25.4 millimeters.
     *
     *     dpi = N pixels / (M millimeters / (25.4 millimeters / 1 inch))
     *         = N pixels / (M inch / 25.4)
     *         = N * 25.4 pixels / M inch
     */

DPI results:

  • xrandr: 1920 x 25.4 / 344 = 141 (correct, but displaying issues)
  • xdpyinfo: 1920 x 25.4 / 508 = 96

I suspect X library to give real and 96dpi-like physical sizes.
Those from xdpyinfo are 96dpi-like sizes.

Finally, to fix that DPI issue, three options:

  • Finding and adding an option to xrandr command to avoid increasing the value
  • (or) Adding an option to mons for setting arbitrarily a value (if not used 96 by default)
  • (or) Force 96 by default into mons after switching second to primary mode

So be it. I will add a DPI option to mons.

from mons.

dkambersky avatar dkambersky commented on July 30, 2024

Thanks!

from mons.

Ventto avatar Ventto commented on July 30, 2024

Feel free to report issue.

from mons.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.