Installation of Openbox
        
        
          ![[Note]](../images/note.png) 
          
            Note
          
          
            If XORG_PREFIX is not /usr, tell
            gcc about it:
          
          
export LIBRARY_PATH=$XORG_PREFIX/lib
         
        
          If you installed only Python 3 PyXDG module convert one of the
          scripts to Python 3:
        
        
2to3 -w data/autostart/openbox-xdg-autostart &&
sed 's/python/python3/' -i data/autostart/openbox-xdg-autostart
        
          Install Openbox by running the
          following commands:
        
        
./configure --prefix=/usr     \
            --sysconfdir=/etc \
            --disable-static  \
            --docdir=/usr/share/doc/openbox-3.6.1 &&
make
        
          This package does not come with a test suite.
        
        
          Now, as the root user:
        
        
make install
       
      
        
          Command Explanations
        
        
          --sysconfdir=/etc: This option puts
          Openbox's configuration files in
          /etc/xdg/openbox instead of /usr/etc/xdg/openbox.
        
        
          --docdir=/usr/share/doc/openbox-3.6.1:
          this puts a few files in a versioned directory in /usr/share/doc.
        
        
          --disable-static: This
          switch prevents installation of static versions of the libraries.
        
       
      
        
          Configuring Openbox
        
        
          
            Config Files
          
          
            /etc/xdg/openbox/autostart, /etc/xdg/openbox/menu.xml,
            /etc/xdg/openbox/rc.xml, ~/.config/openbox/autostart,
            ~/.config/openbox/menu.xml and ~/.config/openbox/rc.xml
          
         
        
          
            Configuration Information
          
          
            Openbox's right click menu can
            be used to launch programs. The menu itself is configured with 2
            files, /etc/xdg/openbox/menu.xml
            and ~/.config/openbox/menu.xml. To
            make changes to the menu, copy /etc/xdg/openbox/menu.xml to
            ~/.config/openbox/menu.xml and edit it:
          
          
cp -rf /etc/xdg/openbox ~/.config
          
            ~/.config/openbox/menu.xml can be
            edited with a text editor or you can install Obmenu (requires
            pyxml and PyGTK-2.24.0).
          
          
            To have icons in your right click menu requires installing
            Imlib2-1.4.9 before you install Openbox. To set an icon for an entry in the
            menu edit ~/.config/openbox/menu.xml and add an icon to
            the <item> tag like this:
          
          
<item label="Mplayer" icon="/usr/share/pixmaps/mplayer.png">
          
            Many other aspects of Openbox's
            behaviour are configured with ~/.config/openbox/rc.xml such as what
            keybindings are used to launch programs or which mouse button
            launches the main menu.
          
          
            Details of the theme that Openbox applies to window decorations are
            configured in ~/.config/openbox/rc.xml. You can get a list of
            the available themes with the command:
          
          
ls -d /usr/share/themes/*/openbox-3 | sed 's#.*es/##;s#/o.*##'
         
        
          
            Starting Openbox
          
          
            To automatically start openbox when you start
            Xorg:
          
          
echo openbox > ~/.xinitrc
          
            If you want to set a background image to your desktop you can use
            display and launch it from
            ~/.xinitrc just before openbox:
          
          
cat > ~/.xinitrc << "EOF"
display -backdrop -window root /path/to/beautiful/picture.jpeg
exec openbox
EOF
          
            Or if you like a bit of variety, put a selection of images in a
            folder (in this example, the directory ~/.config/backgrounds) and
            choose one at random each time you xinit:
          
          
cat > ~/.xinitrc << "EOF"
# make an array which lists the pictures:
picture_list=(~/.config/backgrounds/*)
# create a random integer between 0 and the number of pictures:
random_number=$(( ${RANDOM} % ${#picture_list[@]} ))
# display the chosen picture:
display -backdrop -window root "${picture_list[${random_number}]}"
exec openbox
EOF
          
            If you like to have the numlock key set whan you start Xorg,
            install 
            Numlockx and add that to your xinitrc. Another useful
            application is D-Bus-1.10.10:
          
          
cat > ~/.xinitrc << "EOF"
. /etc/profile
picture_list=(~/.config/backgrounds/*)
random_number=$(( ${RANDOM} % ${#picture_list[*]} ))
display -backdrop -window root "${picture_list[${random_number}]}"
numlockx
eval $(dbus-launch --auto-syntax --exit-with-session)
lxpanel &
exec openbox
EOF