You are not logged in.

#1 2016-09-09 08:02:27

halogen
Member
Registered: 2014-06-12
Posts: 67

[SOLVED] Change DPI for GDM

Apparently my monitor is not correctly identified, so to set the correct DPI on my Gnome desktop I'm using xrandr in a script called from the /etc/xdg/autostart/ directory.

It works, but I'd like to change the DPI as soon as possible (before I log in), so that GDM uses the correct settings too.

I already tried creating /etc/X11/xorg.conf.d/90-monitor.conf as detailed in the wiki, but GDM is unaffected.

I've also seen this hack, haven't tried yet but I'd like to find a better solution if possible.

Any suggestions?

Last edited by halogen (2016-12-21 16:16:12)

Offline

#2 2016-11-22 14:46:55

AsavarTzeth
Member
Registered: 2014-01-23
Posts: 2

Re: [SOLVED] Change DPI for GDM

After being stuck with this problem for well over a year I have finally solved it. I tried the "hack" you mentioned (not really a hack in my opinion) and it works.

First, do note that in my case the problem was setting the scaling-factor to match my 4k display. It really doesn't matter if your need differs because the root cause is the same. The problem is that gdm runs as its own unprivileged user "gdm". It uses the same configuration system as everything else, but you can't edit it in gsettings, dconf or "System Settings" as a regular user.

So simply, here is a gsettings one liner that will fix it. Simply change the schema/key/value to fit your needs.

sudo su - gdm -s /bin/sh -c 'export `dbus-launch`; gsettings set org.gnome.desktop.interface scaling-factor 2; kill $DBUS_SESSION_BUS_PID'

You can't use su directly since that would require the gdm user's password. I use sudo to bypass that step but using su - first would work as well.

Now I can finally fill in this missing part in the Arch Wiki!

Offline

#3 2016-12-21 16:16:02

halogen
Member
Registered: 2014-06-12
Posts: 67

Re: [SOLVED] Change DPI for GDM

Thanks for sharing your solution! Since scaling-factor only allows whole numbers and I need a font scaling factor < 2, I modified your one liner to use text-scaling-factor (which allows non-integer values) instead of scaling-factor. Thanks again.

Last edited by halogen (2016-12-21 16:17:00)

Offline

Board footer

Powered by FluxBB