Lightweight Login

I have a fascination with lightweight software. To me they just make sense. Why use a flashier application if all the needed functionality exists in a less resource intensive program?

So, when I switched from Ubuntu to Arch I followed the Arch philosophy and went for the lightest programs that still had all the functionality that I wanted and I went with LXDE instead of the more mainstream GNOME, KDE (or even XFCE4). Its extremely light and modular, any one of its parts can be switch out for equivalent software. Changing settings has been a bit more in depth than when I used GNOME, but all in all the change wasn't hard at all.

One great thing I found that I didn't even miss was a login manager. With other desktop environments, when you boot your computer you see a nice loading bar, then a login window with some nice background and maybe user profile pictures. But none of this is really necessary. You can boot to a console and start X from there. You can even tweak it so that login into console boots X, your DE and all the programs you want at startup automatically, replacing all the functionality of a login manager except for the pretty graphics.

The code to automate X startup when login in is a simple change to your ~/.bash_profile

# If loging in on tty1, automatically startx
if [ "$(tty)" = "/dev/vc/1" ]; then

This checks if you're login in on the first console (you don't want every console login to start X) and runs the startx command. When you log out of your desktop, X quits and it runs the logout command, bringing you back to your very minimal login screen.

To auto-start applications I found it easiest to just background them in my
file. This is the file X reads when it starts. Here's what mine looks like:

conky &
feh --bg-scale ~/Pictures/Wallpapers/Frozen_Trees.jpg &
pidgin &
tilda &
zim --iconify &
exec ck-launch-session startlxde

The ampersand (&) after the first 5 commands makes these programs run in the background (so that more than one can start) and exec tells X that launching lxde is the last command it has to read.

There you have it, my super light login manager.

Update June 29, 2009: I've been doing more testing (read sitting in front of my computer with a stop watch) and as long as the preload daemon is backgrounded in your rc.conf file it's faster than if you start it at login. To test, I let it auto log me in, started the timer when I pressed my power button and stopped it when my wicd tray icon showed an internet connection. 'Booting with preload' beat 'Login with preload' on average by 2-3 seconds.


Post a Comment