How to autostart X at login without SDDM (boot to your DE/WM without login) 16 December 2017, 07:30:25 I stuck this in the thread that is asking for suggestions for the FAQ. On second thoughts it is likely better off out here with its own title as it will make it easier for someone to find if they are looking for a how-to on this topic (autologin without a display manager - some of us operate our systems in "secure" environments, & also don't like to use DM's for whatever reason ).I'm sure that someone can come up with alternative ways, perhaps there is a more correct way? I don't know?I didn't create the following, I searched it out on the web, & it works perfectly for me (I'm using Openbox), & it was really quite quick & easy to do.So here you go:To start X automatically:Make your /etc/conf.d/agetty.tty1 the same as the following:# Set the baud rate of the terminal linebaud="38400"# set the terminal typeterm_type="linux"# extra options to pass to agetty for this portagetty_options="--autologin guest"# make agetty quiet#quiet="no"Be sure replace guest in the above code, to the user name that you desire to autologin.Put the following into the user's ~/.bash_profile :# Start x on loginif [[ -z $DISPLAY && ! -e /tmp/.X11-unix/X0 ]]; then exec startxfiApart from the above, you will just need to use pacman to delete sddm, lightdm or whichever other DM you have installed. After you have done that, the above changes should allow you to boot straight into your WM or DE without any user input (no logging in with user names & passwords).Note: the above code & information came from the Porteus forum: http://forum.porteus.org/viewtopic.php?p=58946&sid=7e00b1918e3bc2d578709e57979e0bd1[edit:] If a system update makes you have to startx manuallyThus far, once, I've had an update that overwrote the /etc/conf.d/agetty.tty1 which of course meant that I had to login manually again.All that was required (in my case) was changing the following line:agetty_options=""Back to:agetty_options="--autologin handy"So you just have to add --autologin <your.user.name> between the double quotes & your good to go.You could stop this from happening in future by using one of the two following methods. I used this first one today, but after @thefallenrat posted a link below, I am now using the 2nd method shown here, as it is more elegant:Method 1. Making the agetty.tty1 file immutable like so:$ sudo chattr +i /etc/conf.d/agetty.tty1If you need to make the file changeable again then do this:$ sudo chattr -i /etc/conf.d/agetty.tty1If you want to list the file attributes of a file that is using the second extended file system (which is what the chattr command is using), you use the following command like so:$ lsattr /etc/conf.d/agetty.tty1Which will give a result like so:----i---------e---- /etc/conf.d/agetty.tty1Method 2. (quoted from the Arch Wiki)QuoteTo prevent any package from overwriting a certain file, add the following line to /etc/pacman.conf:NoUpgrade = absolute/path/to/fileNote that the path must not start with a slash. Which means that I've uncommented the # NoUpgrade = line in my /etc/pacman.conf & it now looks like this:NoUpgrade = etc/conf.d/agetty.tty1So that is a much more Arch way of doing things. Last Edit: 07 January 2018, 09:07:39 by handy
Re: How to autostart X at login without SDDM (boot to your DE/WM without login) Reply #1 – 07 January 2018, 03:17:12 Today's update overwrote the /etc/conf.d/agetty.tty1 which of course meant that I had to login manually again.I've edited to the OP above. Last Edit: 07 January 2018, 03:57:54 by handy
Re: How to autostart X at login without SDDM (boot to your DE/WM without login) Reply #2 – 07 January 2018, 04:04:28 Quote from: handy – on 07 January 2018, 03:17:12Today's update overwrote the /etc/conf.d/agetty.tty1https://wiki.archlinux.org/index.php/Pacman/Pacnew_and_Pacsave#Systemwide_backup_files
Re: How to autostart X at login without SDDM (boot to your DE/WM without login) Reply #3 – 07 January 2018, 08:06:32 @thefallenrat Thanks, that is a much nicer way to stop a file from being overwritten. I'll edit the OP to reflect this new (to me) info'.
Re: How to autostart X at login without SDDM (boot to your DE/WM without login) Reply #4 – 19 May 2018, 11:58:27 Thanks for this, really nice.I also run openbox wm and tried this out, works beautifully.This automatically logs me into the desktop so as an added security measure i have added xtrlock & at the end of my ~/.config/openbox/autostartThis locks the desktop using xtrlock - https://www.archlinux.org/packages/community/x86_64/xtrlock/You could use any screen locker that works but i like xtrlock.