Urm, lovely. As in,
sudo
vs.
su
does not on this 19.3 Cinnamon system seem to make a difference as such but
both su
and
sudo
need to launch a login shell so as to have a basic user environment, and need DBUS_SESSION_BUS_ADDRESS (or DISPLAY at minimum, to allow a new instance to launch) set explicitly for this to work at all. I.e., both these work from a root shell:
Code: Select all
su -l rene -c "env DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus gsettings set org.cinnamon.desktop.interface gtk-theme Mint-Y"
and
Code: Select all
sudo -u rene -i env DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus gsettings set org.cinnamon.desktop.interface gtk-theme Mint-Y
Note; "root shell" as from a virtual console, i.e., without yet another level of sudo involved...
Without
-l
resp.
-i
and/or DISPLAY or DBUS_SESSION_BUS_ADDRESS itself defined, neither works. This of course also means that if the user is not logged in, or given the lingering behaviour of logind at the very least has not
been logged in, this still won't do, no DISPLAY or session bus existing in the first place: the system-sleep script would ideally check for existence of /run/user/<uid>/bus for the relevant <uid> before doing anything.