I have been using CDM to log into X on my Arch machines and, if I were to continue to require the ability to access different window managers with any frequency, I would use this approach. However, on my EeePC, I really only ever login to a dwm session or the console, so having a login manager seemed like an unnecessary step.
Consequently, over the weekend, with the help of the Start X at Boot article on the Arch Wiki, I removed CDM and arrived at a secure, flexible approach to logging into X (or the console).
My /etc/inittab already boots me into runlevel 5:
So it was just a case of putting a couple of lines in the correct invocation file. I chose $HOME/.bash_profile because I only use Bash; if you use another shell you should probably go with $HOME/.profile. The recommended lines from the Arch Wiki are:
1 2 3 4 5
…and this works as advertised. If you are in TTY1 and you login, X is started. The disadvantage for me, though, was that when you shutdown, you must manually change to TTY7 (if that is your last agetty) to see the shutdown messages.
After rummaging around through various man and web pages, I finally
alighted on this helpful option:
-novtswitch. So, my entry to start X
now looked like:
1 2 3 4 5
Now, on shutdown and reboot, I see all of the shutdown messages. All that remained was to add an option to log into a tmux session if I didn’t want to use X. The final code looks like this:
1 2 3 4 5 6 7
Logging in from TTY1 takes me into my dwm session, if I switch to TTY2 I am logged into a tmux session with keychain running. To start consolekit with dwm, I have this in my $HOME/.xinitrc:
You can see my full $HOME/.bash_profile in my mercurial repo.
For various reasons, I moved my environment variables from $HOME/.bashrc
into $HOME/.profile; this meant that these variables were only inherited in
interactive shells if
xinit was called with
I have also ditched
consolekit - for all of the processes it was
spawning, it actually wasn’t performing any critical functions; or
indeed any functions that I really needed at all…