Live data from Hacker News

A few HiDPI tricks for Linux

blog.yossarian.net

41–50 of 192 posts

Re: A few HiDPI tricks for Linux

#41
Credit where credit is due this is the one area where Windows is the best OS these days. It not only will do fractional scaling but it will do display independent fractional scaling - whack in the scaling percentage on each screen and in the recent versions of Windows 10 it works well and looks great and remembers your settings when you plug that monitor back in. It is perhaps THE thing along with WSL2 (now giving me a ‘real’ Ubuntu commandline as well as Docker/Kubernetes experience where disks are mounted on both sides and things work seamlessly via VS Code) that made me choose Windows over the Mac and Linux this time around.

Re: A few HiDPI tricks for Linux

#42
post #17

I am using Retina display on which everything looks tiny. I struggled with setting up QT scaling, GTK3.0 scaling, icon sizes, font DPI and resolutions. The problem is there is no single setting which all UI libraries follow and this makes your life hell. Even worse is when you connect an external monitor which is not HiDPI and now everything is bigger than usual. Instead scale the whole display and this works perfect…

> Even worse is when you connect an external monitor which is not HiDPI and now everything is bigger than usual.

This has been a real bugbear for me. I'm a big fan of small sharp bitmap terminal fonts, but as my new laptop is now the same resolution as my external monitor I have a choice between comically small on the laptop display or comically huge on the monitor.

Re: A few HiDPI tricks for Linux

#43

Credit where credit is due this is the one area where Windows is the best OS these days. It not only will do fractional scaling but it will do display independent fractional scaling - whack in the scaling percentage on each screen and in the recent versions of Windows 10 it works well and looks great and remembers your settings when you plug that monitor back in. It is perhaps THE thing along with WSL2 (now giving me…

Yep. Windows 10 is fantastic in this regard.

MacOS on the other hand sucks. Basically the recommendation is to run a lower and blurry resolution if you want bigger buttons and text...

At the same time, iOS has great scaling and text sizing options, and macOS’ interface is so abstract that it should be very easy to vectorize it, enabling seamless scaling to any size wanted.

Really baffling.

Re: A few HiDPI tricks for Linux

#44
post #40

Earlier quoted context omitted.

The question is, how do we fix this? Is there a best setting to use, and if not, who will join the working group to define one?

It's fixed in Wayland.

Is it intrinsically fixed, or is it up to the compositor to do the right thing? (implying it may be broken in some compositors)

Re: A few HiDPI tricks for Linux

#45

Credit where credit is due this is the one area where Windows is the best OS these days. It not only will do fractional scaling but it will do display independent fractional scaling - whack in the scaling percentage on each screen and in the recent versions of Windows 10 it works well and looks great and remembers your settings when you plug that monitor back in. It is perhaps THE thing along with WSL2 (now giving me…

Yep. Windows 10 is fantastic in this regard. MacOS on the other hand sucks. Basically the recommendation is to run a lower and blurry resolution if you want bigger buttons and text... At the same time, iOS has great scaling and text sizing options, and macOS’ interface is so abstract that it should be very easy to vectorize it, enabling seamless scaling to any size wanted. Really baffling.

Yep - all our screens at work are not 4K but 2K (1/2 being the ultra wide curved ones) and I find that the MacBooks look just awful on them as it doesn't see them as 'retina'. It was really strange at first as I always remembered Macs to have great font rendering when displays were even lower res than that but I can't stand how it looks on them. Having Windows scale to 150% on them just looks soo much better. I have a 4K 15" ThinkPad and a 4K 27" external at home and, even though they are the same resolution, they are such different sizes and I like to scale them differently to make things closer to the same size when I drag them back and forth - but only when docked. At other times I scale at a lower percentage to give me more realestate. With Windows I can do this on the fly these days without even logging off and everything looks great and 'just works'.

Re: A few HiDPI tricks for Linux

#46
post #35

Some other resources that may be helpful for anyone looking is (of course) the Arch wiki [0]. I also found it helpful to set somethings like DPI based on the machine (I share my dot files across my computers) which can be done pretty easily using e.g. the hostname [1]. (Note that GitHub doesn't perfectly render the org file, you'd want to see the raw file for details if interested in literal dotfiles.) [0] https://wi…

[deleted]

Re: A few HiDPI tricks for Linux

#47
My settings are:

GTK2 apps do not support HiDPI correctly. oomox (and similar) can be used to generate a scaled GTK2 theme, but it won't solve all your problems.

GTK3 supports HiDPI well. If you use Gnome, Xfce and others, you can configure this via the preferences UI. Otherwise, add this to your .profile file:

    export GDK_SCALE=2
    export GDK_DPI_SCALE=0.5
Many Java apps can be scaled by adding an argument...

    java -Dsun.java2d.uiScale=2
For Qt you can add this to your .profile file:

    export QT_AUTO_SCREEN_SCALE_FACTOR=0
    export QT_SCALE_FACTOR=2

    # For theming, requires qt5ct
    export QT_QPA_PLATFORMTHEME=qt5ct
For Spotify... I use ncspot for listening, and the web version to manage my playlists (although you can also management with ncspot). ncspot is a keyboard friendly, lightweight terminal client.

    https://github.com/hrkfdn/ncspot
I use FreeOffice as office suite, you can configure HiDPI through the menus and works perfectly. Same with Steam.

Re: A few HiDPI tricks for Linux

#48
post #40

Earlier quoted context omitted.

It's fixed in Wayland.

Is it intrinsically fixed, or is it up to the compositor to do the right thing? (implying it may be broken in some compositors)

There's only integral buffer scales, so it's entirely up to the compositor or client to do fractional scaling.

https://wayland-client-d.dpldocs.info/wayland.client.protoco...

Re: A few HiDPI tricks for Linux

#49

Credit where credit is due this is the one area where Windows is the best OS these days. It not only will do fractional scaling but it will do display independent fractional scaling - whack in the scaling percentage on each screen and in the recent versions of Windows 10 it works well and looks great and remembers your settings when you plug that monitor back in. It is perhaps THE thing along with WSL2 (now giving me…

This also works well on GNOME Wayland (and probably other Wayland compositors) since about 1.5 years ago (for me at least). In the display settings you can pick a scale per monitor and almost all apps will respect it. (It seems some apps with custom toolkits are lagging but I can't remember the last time I ran into one of these).

Re: A few HiDPI tricks for Linux

#50
post #39

Plasma wayland has per-screen DPI scaling to any percentage you want. Only thing holding me back from switching is screen recording/sharing woes.

Have you set up pipewire? It doesn't seem to be the default in any distros yet but it works fine for me. The only real issue is that the permission dialog on Firefox makes you select the window or screen to share twice. Not seamless but gets the job done.
Post reply on HN