From Installing OpenBox 3.4.2 in Foresight Linux
This is a new version of the blog post as we should have this howto in our Wiki. And we should keep this uptodate.
What is Openbox?
From the Openbox homepage,
"Openbox is a minimalistic, highly configurable, next generation window
manager with extensive standards support." From using it, I often think
of fluxbox with the benefits of being able to dip into Gnome or KDE for
the items that I want to use. Your desktop will then run with speed and
simplicity using only the elements you want to use with it.
Absolute Minimal Openbox
First we install group-openbox. Conary organizes packages in groups, so if you install this group all core Openbox packages will be installed:
$ sudo conary update openbox obmenu obconf
You can now log off and login again - choose "Openbox" as a session. Openbox is minimal by default though so when you login to the environment for the first time, there will be no taskbars, nothing...just a large blank area. You can left or middle click to open menus.
Some comfort: obmenu
Obmenu is a menu editor designed for openbox. It's easy to use, allowing to get the most out of the powerful Openbox menu system, while hiding the xml layout from the user.
It also (optionally) installs a bunch of dynamic menus (pipe menus), such as Gnome menus or a quick-navigator.
pypanel
Pypanel is a lightweight panel/taskbar written in Python and C for X11 window managers.
$ sudo conary update pypanel
Copy the default configuration file for pypanel so that you can customize the panel:
$ cp /usr/share/pypanel/pypanelrc ~/.pypanelrc
pypanel &
tint2
Tint2 is a simple panel/taskbar unintrusive and light (memory / cpu / aestetic). We try to get 'virtual desktop' and 'multi-monitor' easier to use. We follow freedesktop specifications.
$ sudo conary update tint2
Copy the default configuration file for tint2
$ cd ~/.config && mkdir tint2 $ cp /etc/xdg/tint2/tint2rc ~/.config/tint2/tint2rc
Next, make sure you add it to your ~/.config/openbox/autostart.sh
tint2 &
fbpanel
fbpanel is a very fast and functional menu bar. This panel also also is an area where we can dock any Gnome services/icons that we want to dock such as Pidgin and Banshee To install fbpanel:
$ sudo conary update fbpanel
Now we need to copy the default configuration file for fbpanel so we can build our panel to our liking:
$ mkdir ~/.fbpanel $ cp /usr/share/fbpanel/default ~/.fbpanel
Next, make sure you add it to your ~/.config/openbox/autostart.sh
fbpanel &
Let the Configuration Begin!
Now we need to configure Openbox so that it's ready for us when we logout of Gnome. The configuration files reside in ~/.config/openbox.
We'll need to either use obconf and obmenu which will create
the files we need or manually create them ourselves. There are some files that we'll need to make manually though
Visiting there now will show that there aren't any files in this
directory. The file we'll absolutely need to create is autostart.sh.
Other files that will be in here are rc.xml which is for obconf
(openbox configuration) and menu.xml (openbox menu system). Those two
files will be created once you are in openbox and have initiated the
commands obconf and obmenu.
The autostart.sh file is what starts all of our services and our
fbpanel we just installed as well as setup our wallpaper and other
items. Instead of going through the options
you can place in here,
# This shell script is run before Openbox launches. # Environment variables set here are passed to the Openbox session. . $GLOBALAUTOSTART # Start Your Panel (sleep 2 && fbpanel) &
To create the menu.xml file for openbox, we'll copy from the default
installation to our .config/openbox directory (so we can use
obmenu...otherwise, that command will give us an error) so use the
following command in a terminal:
$ cp /etc/xdg/openbox/menu.xml ~/.config/openbox/
If you'd like to configure your fbpanel (it already has a default
appearance from the file we copied) you may do so at any time. Do this
by opening your ~/.fbpanel/default file in your favorite text editor.
Then visit the documentation page on the fbpanel homepage
and edit your fbpanel according to your taste. If there is interest, I
can cover customizing the fbpanel in a later post. For now, we'll go
with the default settings and I'll take a screenshot of my customized
one so you can see what is possible.
Now you're ready to login and reap what you have sown
Logout of
Gnome and change sessions in GDM to Openbox. Notice that your pypanel
starts up and has the gnome applications we recorded in the
autostart.sh file above running and docked! You can add more options to
your autostart.sh file and you can also edit .fbpanel/default (in your
/home/user directory) to store settings for your panel.
I've Installed and am Running, Now What?
Now you get to customize the Openbox menu with your favorite applications. Menus are activated by right clicking anywhere on the desktop. There are a few default applications...I choose obconf right away so that I can choose a theme I like and increase the text size since I'm using a high resolution. After that is done, I right click
for the menu again and go to applications >> xterm. When the terminal pops up, I type obmenu. From there, I'll be able to edit my right click menu.
Now instead of entering obmenu in a terminal each time, let's add it to our right click options. In obmenu window that you opened in the last paragraph, expand the Openbox 3 option. Find obconf and highlight it. Click 'new item' and add obmenu for a label, execute for action, and obmenu for Execute. This will add obmenu to your right click
options so you don't have to open a terminal each time to do things. You can also customize any of the items you find in applications...I put a few things I normally need such as thunderbird, firefox, gnome-terminal, etc. Feel free to add whatever you need...you can have many submenu's . It's setup is pretty straightforward.
Alternative Panels
There are quite a few alternative panels out there. Pypanel is one. Perlpanel is another. Pypanel is available in the Foresight repositories. So, if you don't like bugs and just want a simple panel with xml configuration file (pypanelrc) then substitute pypanel for fbpanel or gnome-panel above and you'll be set. There are more than just these two but these two are the ones I've seen websites note about openbox.