I would like to change the locale on the SDDM login screen to use a 24 hour clock format. The greeter seems to run under the sddm user account and I have tried setting the following in the /usr/share/sddm/.config/Xstartup file:
By default the startup script used by SDDM is /usr/share/sddm/scripts/Xsetup, but it could have been changed in /etc/sddm.conf (option “DisplayCommand=”).
You could try to export those variables there, but I have no idea whether this will have the desired effect.
And/or set the locale in /etc/sysconfig/language, but that would affect all users then.
Not Xsession, Xsetup!
But then, this might be run too late.
This is okay for a personal machine, but it sure would be nice to specify this for SDDM exclusively somewhere.
Well, you could probably modify the start scripts accordingly.
If you use the generic display-manager.service:
either:
/usr/lib/systemd/system/display-manager.service
/usr/lib/X11/display-manager
/usr/lib/X11/displaymanagers/sddm
If you use the specific sddm.service instead, it’s in /usr/lib/systemd/system/display-manager.service (which starts sddm directly).
Updates will probably overwrite your changes though. In case of systemd’s .service files, you can copy them to /etc/systemd/system/ though and modify the copy.
I’m not sure though what the best way/place would be to set your variables.
Maybe modify the ExecStart line accordingly, to something like:
Right, but SDDM’s greeter (i.e. the login screen that you see) runs as user “sddm” for security reasons.
Btw, “sddm”'s home directory is /var/lib/sddm/, not /usr/share/sddm/. So creating a file in /usr/share/sddm/.config/ doesn’t make any sense anyway (sorry, that I didn’t notice that until now). But I don’t think /var/lib/sddm/.config/Xstartup would help either. Actually “sddm” doesn’t login to an X session at all. Just the SDDM processes run as this user id to be restricted.
Neither Xsession nor Xstartup seem to have any effect, if I add statements to them. So I think I’ll stick with my changes to /etc/sysconfig/language for now.
I think the correct action would be to push for an option to set the locale in /etc/sddm.conf
It’s neither Xsession nor Xstartup, it’s Xsetup (in /usr/share/sddm/scripts/) by default.
That’s what you need to change (unless set otherwise in SDDM’s config), not something in /var/lib/sddm/.config or anywhere else.
I’m not sure whether setting the locale envvars there would have effect though.
I think the correct action would be to push for an option to set the locale in /etc/sddm.conf