You are not logged in.

#1 2019-06-12 08:10:00

LinuxShadow
Member
Registered: 2019-05-04
Posts: 21

i3 - HiDPI setup with multiply monitors

Hi there,

I've got a laptop with an HiDPI monitor (2560x1440; 14").

xdypinfo | grep -B2 resolution

tells me that the monitor has an DPI of 96.

The problem is, I want to scale it to 125%. First, I tried to achieve this with changing the dpi by using

xrandr --dpi

. This however does
not work, as now everything is way to large when I'm connecting my laptop via HDMI to an FHD external monitor. A friend of mine told me than to run this command:

xrandr --output eDP-1 --scale 1.25x1.25 --panning 2560x1440 --mode 2560x1440

Afterwards my desktop is rendered only on a part of my screen. Another problem I can see with this is, that when applying a proper scale after connecting to an 4k monitor, I always have to manually reset the scale when connecting back to an FHD monitor and applying it again when connecting to an HiDPI screen.

I'm currently using LightDM as my login manager and i3 as my desktop/window manager with X.Org. Note however, that I do not want to scale LightDM, I only want to apply a scale to my i3 session.

Is there any way how I can manage this setup?

LinuxShadow

Last edited by LinuxShadow (2019-06-13 20:52:55)

Offline

#2 2019-06-12 11:07:31

seth
Member
Registered: 2012-09-03
Posts: 11,260

Re: i3 - HiDPI setup with multiply monitors

Please remove the tag from the subject and ensure to have read up https://wiki.archlinux.org/index.php/HiDPI and esp. http://wok.oblomov.eu/tecnologia/mixed-dpi-x11/
You can use https://aur.archlinux.org/packages/x-on-resize/ to automize stuff

Offline

#3 2019-06-13 21:24:21

LinuxShadow
Member
Registered: 2019-05-04
Posts: 21

Re: i3 - HiDPI setup with multiply monitors

seth wrote:

Please remove the tag from the subject and ensure to have read up https://wiki.archlinux.org/index.php/HiDPI and esp. http://wok.oblomov.eu/tecnologia/mixed-dpi-x11/
You can use https://aur.archlinux.org/packages/x-on-resize/ to automize stuff

I've read up the article about HiDPI on the Arch Wiki and it states that for i3 the dpi has to be changed within ~/.Xresources, thought as far as my understanding goes, this will set the dpi globally for
all monitors. The section about "Multiply Displays" seems to cover my usecase somewhat? but not entirely. As soon as I've got time, I'll look into the last two links (thought this " Mixed DPI and the X Window System"
looks promising). wink

Offline

#4 2019-06-15 22:35:54

LinuxShadow
Member
Registered: 2019-05-04
Posts: 21

Re: i3 - HiDPI setup with multiply monitors

seth wrote:

Please remove the tag from the subject and ensure to have read up https://wiki.archlinux.org/index.php/HiDPI and esp. http://wok.oblomov.eu/tecnologia/mixed-dpi-x11/
You can use https://aur.archlinux.org/packages/x-on-resize/ to automize stuff

Ok, according to those articles, I should scale my primary monitor (the internal one) by changing the Xft.dpi setting within ~/.Xresources, execute xrdb -merge ~/.Xresources and then set the resolution of my external monitors to the one of my HiDPI monitor and scale those down or up to their native resolution (depending on whether those have a higher or lower resolution than the internal resolution), am I correct?
Changing the Xft.dpi from 96 to 120 (125%) and executing the xrdb -merge command, then logging out and logging in again (using LightDM) causes my desktop (i3) to be rendered only on a part of my screen.
I'm also looking into this tool, thought at first I want to know how this all works when doing it the manual way.

Offline

#5 2019-06-16 05:39:38

seth
Member
Registered: 2012-09-03
Posts: 11,260

Re: i3 - HiDPI setup with multiply monitors

A re-login has a ginormous chance of restarting the X11 server, loosing all xrdb settings.
https://wiki.archlinux.org/index.php/X_resources

Setting the dpi via xrandr is still "required" (assuming it's for some reason not initially correct)

You won't get around scaling one of the outputs because X11 supports only one logical DPI.
Clients *can* determine the physical DPI and their screen position and adapt their rendering, but that possibility is underused and afaik not used dynamically (when you reposition windows) at all.

The "broken" rendering of i3 is likely because it missed a resize of the root window, typically because you're forking xrandr or i3 calls (or because i3 ignores randr events) - ensure to run xrandr before i3

Offline

#6 2019-06-16 12:59:14

LinuxShadow
Member
Registered: 2019-05-04
Posts: 21

Re: i3 - HiDPI setup with multiply monitors

seth wrote:

A re-login has a ginormous chance of restarting the X11 server, loosing all xrdb settings.
https://wiki.archlinux.org/index.php/X_resources

Ah, ok. Thought wouldn't "xrdb -merge ~/.Xresources" automatically merge the settings with the current one in order to not loose the settings when X11 restarts?

seth wrote:

Setting the dpi via xrandr is still "required" (assuming it's for some reason not initially correct)

I don't know if its correct or not. My understanding here is that X11 always reports an DPI of 96.
My laptop monitor (copied from notebookcheck.net): 14 inch 16:9, 2560 x 1440 pixel 210 PPI

seth wrote:

You won't get around scaling one of the outputs because X11 supports only one logical DPI.
Clients *can* determine the physical DPI and their screen position and adapt their rendering, but that possibility is underused and afaik not used dynamically (when you reposition windows) at all.

Thought I would have to scale all outputs. Everything on my internal monitor should be rendered 25% larger while the external monitors: it depends, 4k = 50% larger, WQHD = 25% larger, FHD = normal size.
And my assumption here is: to scale everything on my internal montior in order for it to appear 25% larger I would have to change the DPI within ~/.Xresources from 96 to 120.

seth wrote:

The "broken" rendering of i3 is likely because it missed a resize of the root window, typically because you're forking xrandr or i3 calls (or because i3 ignores randr events) - ensure to run xrandr before i3

With LightDM as the login manager, where should I call the xrandr command? And I guess I should execute it with "xrandr --dpi 120" then?

Thought it's interesting to see how much needs to be done for some simple scaling (coming from environments where I can set the scale factor for each monitor individually to be 100%, 125% etc. without having to know anything about dpi).

Last edited by LinuxShadow (2019-06-16 12:59:50)

Offline

#7 2019-06-16 14:39:34

seth
Member
Registered: 2012-09-03
Posts: 11,260

Re: i3 - HiDPI setup with multiply monitors

The rdb is volatile on the server. You'll have to reload the file everytime the X11 server starts (eg. in some init script)

X11 reports whatever resolution is configured, check "xdpyinfo | grep resolution" for the logical DPI

And my assumption here is: to scale everything on my internal montior in order for it to appear 25% larger I would have to change the DPI within ~/.Xresources from 96 to 120.

Yes, though the more relevant setting is probably "xrandr --dpi 120" (or if you're using the nvidia blob, you can also issue the DPI in the Xorg config/let)
That's *not* scaling the output, "xrandr … --scale …" will cause the output to be rendered at a different size than the outputs resolution and then stretched/squeezed into the output (and as an unfortunate side-effect, the display can look blurry)

It's actually not  much, but if you're in search for a config GUI and therefore a pretty static system layout (ie. DM & DE pre-chosen for you), you're using the wrong distro.
For lightm use this config: https://wiki.archlinux.org/index.php/Li … ng_monitor

Edit: of course not literally, but apply the relevant xrandr calls in that config.

Last edited by seth (2019-06-16 14:40:17)

Offline

Board footer

Powered by FluxBB