I have several user accounts on a machine my mother uses most of the time. How can I sort the users so that her account shows up first in the list?
3 Answers
The login screen doesn't simply sort by name. In fact, in lucid, the default login screen sorts first by usage frequency, and by display name as a fallback. So your mother will show up first after a few times.
-
1That can't be the whole of it. The default user on my machine is one that has never logged in, while the user I use every day for the past year is down at number three. Oct 21, 2010 at 20:56
-
Also, it's weird that after months of logging in with account "A" an unused account "B" turns up on top. This has happened to me a bunch of times on Ubuntu 18.04.5 LTS aka Bionic. Account "B" was setup for experimentation but hasn't beein in use for a while.– somethisJan 1, 2021 at 21:53
I had the same problem, so I did an inquiry:
gdm simple greeter uses ConsoleKit for obtaining the list of users. you can check the list (in the gdm order) by running:
$ ck-history --frequent --seat='Seat1'
user1 148
user2 145
gdm 143
if 'Seat1' is not working, enter seat values from 'ck-list-sessions'.
I do not know of a way to hand edit the ck-history list, but you can easily increase the frequency number for a logged in user e.g. by running (when user2 is logged in):
$ for n in `seq 1 10`; do echo exit|ck-launch-session; done
the numbers will change to
$ ck-history --frequent --seat='Seat1'
user2 155
user1 148
gdm 143
and the login screen user list will be reordered in the same way.
-
1Is this solution still supposed to work, 9 years later? My system doesn't have the
ck-history
&ck-launch-session
commands.– trysisJun 24, 2021 at 13:00
In response to both Gilles and Arancaytar's solutions: they might both be right. I had the same problem as Arancaytar. The account I logged into most frequently was strangely at the bottom of the list. But after reading Gilles solution, I tried logging in not by clicking on my name in the user list, but by clicking on "Others", manually typing my username, and then my password. After that I logged out to check, and my name was on the top of the user list. It seems like the login screen, for some strange reason, only records the frequency of logins when you manually enter your username. I haven't confirmed this definitely though.
In short, for those still having problems, do this:
- Log out.
- Don't log in by clicking your name in the list.
- Click on "Others" instead.
- Log in by manually entering your username.
- Log out to check if your name is now on top of the list.
- If not, repeat step 4 a few more times, and hopefully it'll work.
Comment to say if this is successful for anyone else who still has problems!