Quantcast
Channel: Debian User Forums
Viewing all articles
Browse latest Browse all 3557

Beginners Questions • [O/S] How to display default user in Lightdm on login?

$
0
0
There may be a simpler solution, but here is the solution I found and how I found it.

In /etc/lightdm/lightdm.conf I spotted the line

Code:

# greeter-setup-script = Script to run when starting a greeter (runs as root)
This looked like something usable to reconfigure lightdm when it starts. So I first looked at what we had on hand. The Bash set command displays the variables that have been set.
So I made a script /etc/lightdm/custom-greeter-setup-script:

Code:

#!/usr/bin/env bashset >/tmp/custLightdm
and made it executable:

Code:

#> chmod +x /etc/lightdm/custom-greeter-setup-script
and added this line to /etc/lightdm/lightdm.conf:

Code:

greeter-setup-script=/etc/lightdm/custom-greeter-setup-script
and then restarted lightdm.
In /tmp/custLightdm I saw the line

Code:

HOME=/var/lib/lightdm
In /var/lib/lightdm/ I found the file /var/lib/lightdm/.cache/lightdm-gtk-greeter/state which contains

Code:

$> cat /var/lib/lightdm/.cache/lightdm-gtk-greeter/state [greeter]last-user=myusernamelast-session=lightdm-xsession
This is how lightdm saves the last user which is then used when opening a new session.

So I changed /etc/lightdm/custom-greeter-setup-script with:

Code:

#!/usr/bin/env bashsed -i 's/^last-user=.\+$/last-user=defaultusername/' /var/lib/lightdm/.cache/lightdm-gtk-greeter/state
This replaces any user name with the username you want to use as default. Just change defaultusername to this name, of course.

Statistics: Posted by fabien — 2024-03-11 12:52 — Replies 1 — Views 52



Viewing all articles
Browse latest Browse all 3557

Trending Articles