5 ms·
I'm using a 4k screen and a HiDPI thinkpad (T460p) for my workstation and it works amazingly well even today. Was a wild ride since Skylake + 4k + docking stat
by lima 10y ago
I'm using a 4k screen and a HiDPI thinkpad (T460p) for my workstation and it works amazingly well even today.
Was a wild ride since Skylake + 4k + docking station became stable only recently with Linux 4.9, but scaling always worked.
Here's what it takes:
Xft DPI and hinting settings (font rendering):
# .Xresources
Xft.dpi: 144
Xft.hinting: 1
Xft.hintstyle: hintslight
Xft.antialias: 1
Xcursor.size: 48
Xcursor.theme: Adwaita
xrandr DPI setting (important for IntelliJ, i3 and the like):
xrandr --dpi 144
Put it into .xinitrc, Gnome autostart, i3 config or wherever your DE runs stuff at session startup. I also run it after resuming since it sometimes resets itself.
Now, the most important part - the Gnome scaling settings. Instead of increasing the scaling factor, I leave it at 1x and only increase the text scaling. It's a fractional value and applications still resize appropriately (bonus: reduces the amount of whitespace):
gsettings set org.gnome.desktop.interface text-scaling-factor 1.5
gsettings set org.gnome.desktop.interface scaling-factor 1
Worked well with everything I use (Evolution, virt-manager, LibreOffice, Terminal...).
IntelliJ works fine out of the box with java-1.8.0-openjdk. I recommend the Iosevka font, but any font will work.
Latest Chromium respects the settings and support scaling by a fractional value.
When I'm using a low-res screen, I simply render at a high resolution and then scale it down:
xrandr --output eDP-1 --off
xrandr --output DP-2-1 --left-of eDP-1
xrandr --output DP-2-1 --right-of DP-2-2
xrandr --output DP-2-2 --scale 1.5x1.5 --pos 0x0
xrandr --output DP-2-1 --scale 1.5x1.5 --pos 2880x0
While it looks slightly off, you get used to it quickly and I spend most of my workday looking at a downscaled screen without any discomfort.
The result is pretty much perfect and comparable (if not better) to macOS with a recent distro. I'm happy to help anyone who is struggling to get this working!
On a more general note, the recent changes in Fedora are amazing! Out-of-box experience went from "a lot worse than Ubuntu" to best-in-class.
- BoorishBears 10y agoThe reduced-resolution thing has been a trick for ages, I just refused to use the 4k screen I paid a premium for at half res with horrid (seriously, horrid complete with artifacts and fuzz, I even patched xrandr to disable bi-cubic filtering trying to make it ok and still couldn't stand it) looking text aliasing. I'm impressed you'd call that "pretty much perfect and comparable (if not better) to macOS with a recent distro" Pretty much sums up why I don't think I'll ever really be ok with a Linux DE for daily usage. If that's what your users consider comparable to macOS why bother aspiring to reach macOS's perfect (seriously, perfect, even when you mirror across a low res screen and a high res screen it lets you use the high res screen at a higher size with perfect scaling) handling of any mix of resolutions.
- lima 10y agoI think you misunderstood the scaling part. I'm scaling down from 4k to 1080p for my old monitors. The 4k screen is at its native resolution. Anything else would be sinful :)
- BoorishBears 10y agoThat was amongst the fixes I found on stack overflow, and it was nearly identical as far as issues. Maybe I'd have been ok with comparing that to Windows (where some programs do get scaled down if you start them on a high res screen and move them to a low res screen), but macOS is the definition of perfect handling of multiple monitors. These tricks don't come close to that experience for me, let alone exceed it...
- lima 10y agoDownscaling works fine for me, so I don't know what I'm missing :) It's probably going to look better with Wayland's per-screen DPI setting, but in the meantime, it's good enough (tm) for me. Why Linux font rendering exceeds the macOS experience for me: I like the FreeType rendering much better than macOS - less "blurry". Probably comes down to taste. Unless I'm mistaken, macOS scales down for non-integer sizes while Gnome can be configured to render at a fractional value. Obviously it's much more polished in macOS (otherwise I wouldn't have had to type out the tutorial above), but I'm using Linux for other reasons beyond that and having good font rendering is just a plus - it used to much, much worse.
- rhinoceraptor 10y ago4k at native (unless you're using a single, >30 inch display) is too small. I use two 4k, 28 inch monitors and everything is too small at native resolution. I ran in to a lot of issues doing the xrandr downscaling (my two displays would overlap), so I've just been using Windows partition since this is my gaming PC. My linux partition is Arch, I hope Gnome supports easy fractional scaling soon. Something similar to the display scaling menu on Mac OS would be really nice.
- Adaptive 10y agoVery clever. I hadn't considered doing it like this. The best tip I've come across on HN in forever.
- peterwwillis 10y agoThis is why I won't suggest anyone ever use Linux as a desktop. The level of technical details and steps needed just to get hardware you already own to work... It's like buying a luxury car and then having to assemble the thing.
- BHSPitMonkey 10y agoI've been doing something very similar under Ubuntu for the last year or two (I manually launch a script that resembles your last xrandr snippet whenever I dock my hidpi ThinkPad with my 1440p secondary display). It tends to have varying degrees of success depending on updates that come out. For one, I have to repeat some of the commands in my script because otherwise I don't end up with the same end result every time. After it's done, for some reason the cursor arrow flickers when it's on the primary display. Sometimes, if I'm unlucky, UI window shadows will draw in the wrong place, and when I'm REALLY unlucky the script crashes X entirely. Right now I'm hoping that Wayland (or, if I have to, Mir) end up built in a way that makes this kind of configuration stable, intuitive, and sane.