Can I pass a dpi flag to lightdm to set the proper DPI for X?
Solution 1
In /etc/lightdm/lightdm.conf
, you can override the xserver-command parameter (which usually defaults to simply "X"). Here is mine:
xserver-command=X -dpi 75
This has the intended effect of scaling my entire desktop, gnome programs included. Desktop effects are fine, no odd artifacts. It also sets the xdpyinfo, but xft.dpi must be set separately:
$ xdpyinfo|grep dots
resolution: 75x75 dots per inch
$ xrdb -query|grep dpi
Xft.dpi: 96
See madmuffin's answer for how to set Xft.dpi appropriately.
Solution 2
There actually is a way:
Change this line in /etc/lightdm/unity-greeter.conf
xft-dpi=96
to whatever fits your computer best.
Caution: It will break the desktops looks, some effects might not be avaliable. This is a bug in in Unity and will hopefully be fixed soon.
Related videos on Youtube
dilettant
Updated on September 18, 2022Comments
-
dilettant over 1 year
What is the proper way to set DPI value now? gnome-tweak allows to set only scaling factor, which is unsatisfactory and also not all applications take that into account (Chrome for example).
I would like to pass "-dpi" flag to Xorg when it starts, but can't find a way to configure "lightdm" to do so. Is it possible?
-
Jorge Castro over 12 years@dilettant Does the posted answer work for you?
-
-
dilettant over 12 yearsThanks for pointing at this config, I wasn't aware of it. Nevertheless, it seems it sets only Xft.dpi resoure which I am not sure all modern applications are using.Xorg.0.log still reports "(==) intel(0): DPI set to (96, 96)", while when started with -dpi switch it reports the desired value - "(++) intel(0): DPI set to (142, 142)"
-
dilettant over 12 yearsWell, I gnome 3 applications seems to ignore Xft.dpi value, I still have to set font scaling manually, and that still doesn't work for all applications... Should be noted Windows has similar problems with hi-dpi screens...
-
WLKB over 7 yearsI'm currently trying this on the Ubuntu 16.04 live cd, and it does not get taken into account. I don't reboot, I use
service lightdm restart
. Any ideas?