Using Gnome gsettings on GDM user

Arch GDM wiki suggests that if you need to change some config for gdm, that must be done on gdm user. As a first option, it’s suggested that you run the command below to get shell access to gdm:

# machinectl shell [email protected]

That’s unfortunally is not working:

Connected to the local host. Press ^] three times within 1s to exit session.
/sbin/nologin: invalid option -- 'l'
Try 'nologin --help' for more information.
Connection to the local host terminated.terminated

A bug has been filed on upstream already, so that should be a matter of time to get it fixed on next systemd release.

An alternative for that is running su enforcing a different shell:

# su gdm -s /bin/sh -c 'gsettings set org.gnome.desktop.interface scaling-factor 2' 

However, it fails me:

(process:10904): dconf-WARNING **: 04:08:52.321: failed to commit changes to dconf: Cannot autolaunch D-Bus without X11 $DISPLAY

After some googling, I found a fix to that issue. We basically need to ensure that dbus is running by prepending the command with dbus-launch.

su gdm -s /bin/sh -c 'dbus-launch gsettings set org.gnome.desktop.interface scaling-factor 2'

This should do the trick.