Launching Openbox at Login without typing “startx”
Continuing with my effort to get the maximum performance out of my Crunchbang driven EeePc, I removed Slim login manager in favour of a simple console username and password login.
The problem was that, eventhough it only takes a milisecond, having to type “startx” annoyed me, so I set about trying to find an autostart-startx at login solution.
First I created a .bash_profile in my home dir:
# ~/.bash_profile: executed by bash(1) for login shells.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/login.defs
# include .bashrc if it exists
if [ -f ~/.bashrc ]; then
# set PATH so it includes user’s private bin if it exists
if [ -d ~/bin ] ; then
Then added this line at the end:
if [[ -z “$DISPLAY” ]] && [[ $(tty) = /dev/tty1 ]]; then
Thanks to anonymous_user at Arch forums for the trick: