Results 1 to 9 of 9

Thread: SDDM - locale on login screen (greeter)

  1. #1

    Default SDDM - locale on login screen (greeter)

    Hello all,

    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:

    export LANG=en_US.UTF-8
    export LC_NUMERIC=da_DK.UTF-8
    export LC_TIME=da_DK.UTF-8
    export LC_MONETARY=da_DK.UTF-8
    export LC_MEASUREMENT=da_DK.UTF-8
    export LC_COLLATE=da_DK.UTF-8

    Any suggestions will be much appreciated.

  2. #2

    Default Re: SDDM - locale on login screen (greeter)

    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.

  3. #3

    Default Re: SDDM - locale on login screen (greeter)

    Changing the Xsession file didn't help, but setting the values in /etc/sysconfig/language had the desired effect.

    This is okay for a personal machine, but it sure would be nice to specify this for SDDM exclusively somewhere.

  4. #4

    Default Re: SDDM - locale on login screen (greeter)

    Quote Originally Posted by danishrulez View Post
    Changing the Xsession file didn't help
    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:
    Code:
    ExecStart=LC_TIME=da_DK.UTF-8 /usr/bin/sddm

    (note, this is untested)

  5. #5
    Join Date
    Nov 2009
    Location
    West Virginia Sector 13
    Posts
    15,649

    Default Re: SDDM - locale on login screen (greeter)

    By definition any DM is a system process. The machine does not know Who has started it until the user logs in.

  6. #6

    Default Re: SDDM - locale on login screen (greeter)

    Quote Originally Posted by gogalthorp View Post
    By definition any DM is a system process. The machine does not know Who has started it until the user logs in.
    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.

  7. #7
    Join Date
    Sep 2012
    Posts
    4,973

    Default Re: SDDM - locale on login screen (greeter)

    Quote Originally Posted by wolfi323 View Post
    you can copy them to /etc/systemd/system/ though and modify the copy.
    Or add drop-in in /etc/systemd/system/display-manager.service.d, like
    Code:
    mkdir -p /etc/systemd/system/display-manager.service.d
    cat << \EOF > /etc/systemd/system/display-manager.service.d/50-l18n.conf
    [Service]
    Environment=LC_TIME=xxx
    ...
    EOF

  8. #8

    Default Re: SDDM - locale on login screen (greeter)

    Quote Originally Posted by wolfi323 View Post
    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

  9. #9

    Default Re: SDDM - locale on login screen (greeter)

    Quote Originally Posted by danishrulez View Post
    Neither Xsession nor Xstartup seem to have any effect, if I add statements to them.
    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
    File a report upstream:
    https://github.com/sddm/sddm/issues
    Last edited by wolfi323; 07-Nov-2015 at 09:49.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •