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 lineThis 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:and made it executable:and added this line to /etc/lightdm/lightdm.conf:and then restarted lightdm.
In /tmp/custLightdm I saw the lineIn /var/lib/lightdm/ I found the file /var/lib/lightdm/.cache/lightdm-gtk-greeter/state which containsThis 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:This replaces any user name with the username you want to use as default. Just change defaultusername to this name, of course.
In /etc/lightdm/lightdm.conf I spotted the line
Code:
# greeter-setup-script = Script to run when starting a greeter (runs as root)
So I made a script /etc/lightdm/custom-greeter-setup-script:
Code:
#!/usr/bin/env bashset >/tmp/custLightdm
Code:
#> chmod +x /etc/lightdm/custom-greeter-setup-script
Code:
greeter-setup-script=/etc/lightdm/custom-greeter-setup-script
In /tmp/custLightdm I saw the line
Code:
HOME=/var/lib/lightdm
Code:
$> cat /var/lib/lightdm/.cache/lightdm-gtk-greeter/state [greeter]last-user=myusernamelast-session=lightdm-xsession
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
Statistics: Posted by fabien — 2024-03-11 12:52 — Replies 1 — Views 52