[openbox] Openbox FAQs

Jesper Louis Andersen jlouis at mongers.org
Sun Jan 18 23:59:31 EST 2004

Quoting William O'Higgins (openbox at nerd.cx):

> launch applications with the following syntax: 
> <pre>
> sleep 1 && exec application &
> </pre>

This is b0rked. The other stuff was (with my experience) trivial but
perfectly correct. I think you are right that there is a need for
a better FAQ, but I have only seen 1 of your questions asked in here
since I joined the mailing list. Listing the obvious will not hurt
though. Back to the above:

${HOME}/.xsession is a sh(1) script. Nothing more. Since normal 
sh-syntax (or bash, or ...) applies you can do what you want. I have
never ever heard of a X-server who would execute xsession before it had
its own IPC layer up and working (being TCP/IP based or not). Thus you
do not need to start each command with a sleep. What _do_ matter though
is that when the script exits, so does the user session. This is the
reason the last program should be started with the 'exec' command, 
which passes the stdin and stdout filedescriptors on to the program and
then lets the program replace the shell running. 

Your trick may apply, though, if the programs you start have relation-
ships with each other. My .xsession is very bare, and then again not:

# $Id: xsession.annah,v 1.2 2004/01/19 03:32:42 jlouis Exp $

# This reads in old Xresources
xrdb $HOME/.Xresources

# Disable bell
xset b off & 
# Set keyboard rate to be fast enough
xset r rate 200 50

# Let me get a hook into ssh-agent
eval `ssh-agent -s`

# Set DVORAK keyboard
setxkbmap dvorak

xmodmap -e 'keycode 115 = Meta_L'
xmodmap -e 'add mod1 = Meta_L'
xmodmap -e 'keycode 66 = Control_L'
xmodmap -e 'clear Lock'
xmodmap -e 'add Control = Control_L'

xsetroot -solid grey30

exec /usr/pkg/bin/openbox

What we do is to read in .Xresources vi xrdb, then disable the
annoying bell and crank up the kbd rate. Then we spawn an ssh-agent,
so we can enter ssh-keys with ssh-add(1) easily. Dvorak is a good
keyboard and the xmodmaps maps Ctrl to Caps-Lock. Then we set a good
background screen and ends off with calling openbox by the 'exec' method
such that it replaces the shell. Note no use of sleeps. Note that almost
all of these programs needs the X-server for working correctly.


More information about the openbox mailing list