Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DPI Scaling on NixOS with LightDM + XMonad

I've stripped the xserver configuration on my HiDPI laptop down to just:

  • displayManager: lightdm (autologin, no greeter)
  • windowManager: xmonad
  • desktopManager: none (xterm disabled)

And everything is working fine apart from DPI scaling in some places. Specifically: the cursor size and default tty font are both tiny. Apps - terminal emulators, Firefox, etc - are scaling fine as a result of my X settings (below).

Cursor size, and the slow movement that results, is the biggest pain.

So my question is: why would I see proper scaling in some places and not others? What is responsible for the cursor size and other "core" display stuff?

Stuff I've done/tried:

services.xserver.dpi = 180; (sets xserver flag)

✓ .Xresources settings

Xft.dpi: 180
Xft.autohint: 0
Xft.lcdfilter:  lcddefault
Xft.hintstyle:  hintfull
Xft.hinting: 1
Xft.antialias: 1
Xft.rgba: rgb

export GDK_SCALE=2

export GDK_DPI_SCALE=0.5

export XCURSOR_SIZE=32

export QT_AUTO_SCREEN_SCALE_FACTOR=1

Relevant (?) GH issues:

  • nixpkgs#22652

Using NixOS 18.03

like image 699
Jordan Mackie Avatar asked Apr 06 '18 08:04

Jordan Mackie


1 Answers

Having struggled with this for a while, here are my conclusions...

Whatever black magic is at play making the mouse pointer do it's thing, it has no concern for DPI. In retrospect this seems kinda obvious. A mouse pointer moving across a screen is "lower-level" than a GUI application, such that DPI per se is irrelevant.

The fix? Bigger pointer icon (64x64 worked for me) and more sensitive movement (libinput Accel Speed in my case).

like image 172
Jordan Mackie Avatar answered Oct 15 '22 06:10

Jordan Mackie