Last active
August 14, 2017 12:30
-
-
Save lfir/a635338f6b7797e8b56aad5880ce7668 to your computer and use it in GitHub Desktop.
Set autologin in lightdm configuration file to the currently logged in user.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Tested on Fedora 25 MATE (lightdm version 1.18.3). | |
conf=$"[SeatDefaults] | |
autologin-user=$USER | |
autologin-user-timeout=0" | |
echo "$conf" | sudo tee '/etc/lightdm/lightdm.conf.d/custom-local.conf' | |
#Another way but may be overwritten with updates. | |
#sed -i -e '1,/^\[Seat:\*\]$/b' -e "s/^#autologin-user=$/autologin-user=$USER/" /etc/lightdm/lightdm.conf | |
#sed -i -e '1,/^\[Seat:\*\]$/b' -e 's/^#autologin-user-timeout=$/autologin-user-timeout=0/' /etc/lightdm/lightdm.conf | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment