10 years ago
This tutorial is an example of how to install and set up one particular configuration of Openbox incorporating the tint2 panel and the nitrogen desktop wallpaper manager. There are countless ways you could set up Openbox so my intent is to provide a relatively simple configuration that is easy to use and can be abstracted from.
Wallpaper to the left is available from: http://linuxmint-art.org/content/show.php/LMDE?content=138142
Synaptic is the default package manager for debian and is included in Mint. You can access synaptic via the Mint Menu under "Package Manager" or by running the command "sudo synaptic" the entering the administrative password.
In the Quick Filter textbox type "openbox". This will bring up various packages related to the window manager. From the results click the checkbox and select "Mark for Installation" to the left side of "openbox", "obconf", "obmenu", and "tint2". These are respectively the metafile containing the main packages, the GUI configuration tool, the GUI menu configuration tool and a panel. Now, in the Quick Filter textbox type "nitrogen". Nitrogen is the wallpaper manager used by the CrunchBang linux distribution among others.
Along the toolbar there is an apply changes button, the icon will depend on your icon set. Pressing this will install all packages you have checked with "Mark for Installation".
♦For those not familiar with Synaptic: The button is called Apply instead of install because it can also be used to uninstall, reinstall, and update packages. All changes are selected from the checkbox and none are performed until apply is pressed, allowing you to perform many actions all at once.
In order to log into Openbox you must access it from the login screen. When you log out to the login screen you should find the button for "change session" or just "session" and click on it. This will present you with a list of all the window managers and desktop environments you have installed. Select Openbox, (not Gnome/Openbox or KDE/Openbox). And then log in with your normal user name and password.
You will be presented with a blank screen and a mouse cursor. DO NOT FEAR!
You can access the default Openbox Menu by right clicking anywhere on the desktop. From here you should be able to open any application you have installed on your computer. In order to log out you can select the "Exit" option at the bottom of the menu.
In order to see all programs you have open on all desktops you can middle click anywhere on the desktop, providing you with a simple task manager. You can change desktop workspaces by pressing CTRL+ALT+LEFT and CTRL+ALT+RIGHT.
Many people use Openbox just like this as it provides a bare bones environment for running programs and is friendly to keyboard shortcuts. I'm going to explain how to make this environment a little bit more comfortable for those of us who prefer a slightly more traditional environment.
Your menu will probably look slightly different than the one I have pictured because I have customized mine to my own preferences. I will describe this customization below in Step 7.
The autostart script is located at
~/.config/openbox/autostart.sh. If that file does not exist, then the system-wide default script, located at
/etc/xdg/openbox/autostart.sh, is run instead (from: http://openbox.org/wiki/Help:Autostart).
is equivalent to
where USERLOGIN is replaced by your user login name.
Open the autostart.sh with your favorite plain text editor. I used gedit. The following is my autostart.sh contents. Feel free to copy and paste. As you can see I also have dropbox and something called nm-applet starting. Dropbox is a cloud based file server and nm-applet shows network connectivity.
# Run the system-wide support stuff
# Programs to launch at startup
xcompmgr -c -t-5 -l-5 -r4.2 -o.55 &
nitrogen --restore &
# Programs that will run after Openbox has started
(sleep 2 && tint2) &
The Openbox menu can be configured to run basically any command and display just about any text you want, though some amount of scripting may be required depending on what you want. I will guide you through creating a favorite applications list and a sample scripted action, taking a delayed screen shot.
We already installed the GUI Menu configuration tool called Obmenu. You can start that by going through the right click menu and selecting the program or by launching it in a terminal. However, you may find that it does will not save changes. If this is true it is probably because there is not yet a custom menu file created.
The menu configuration file is located at
~/.config/openbox/menu.xml. If that file does not exist, then the system-wide default located at
/etc/xdg/openbox/menu.xml, is used instead (from: http://openbox.org/wiki/Help:Menus).
The above link also contains advice for manually configuring the file. But once you've put a menu in ~/.config/openbox/menu.xml the GUI program, Obmenu, will save normally.
With the Openbox 3 menu node expanded you can now see all of the items in contains. In order to add an item you must first select where you want it to appear in the menu. A new item or sub-menu will appear directly above the selected item. In the image shown on the left the new item would be added above Terminal emulator.
Once selected move the cursor to the toolbar and left click on the "New item" button if you want a new menu item. Or "New menu" if you want to create a new sub-menu. "New separator" creates a line to visually separate different areas of your menu.
After you've created a new item click on the textbox beside "Label" where "New item" is currently written. Change the text to whatever you want to show on your menu, for example "Firefox" or "Web browser" or "Internet" or even "Series of tubes". Pretty much anything is fine. Below that is "Action" beside which is list which currently shows "Execute" as selected. Execute allows you to run a program or a script from file. Underneath you see the word "Execute" again beside which is a textbox that has defaulted to "command". Replace command with the program or directory path and program you want to run, for example "chromium-browser" or "synaptic". For this field you must type it correctly or the command will not execute. To run things that require administrator privileges prefix the command with "gksudo " for example, "gksudo synaptic". This will prompt for a password and allow you to use administrator privileged tools.
Finally, save changes by clicking the top left button in the menu bar or go to File -> Save or press Ctrl + S.
After you have installed tint2 (assuming you performed steps 1 to 3) run tint2 either by selecting it from the menu or running it from the terminal with:
This should create a default configuration file that we can edit at ~/.config/tint2/tint2rc
So next we edit this with our favorite text editor (there is not as far as I know a GUI editor for tint2). I will use gedit in my example:
I won't go into detail describing the parameters with which you can customize tint2 as they are available from http://code.google.com/p/tint2/wiki/Configure.
Do note that some system tray applets you might be used to don't load by default like pulse audio and network manager.
Great tutorial however there appears to be a problem in LMDE in getting the newly installed Openbox session to launch.
I heard about a little "program", obkey, which acts as a gui for addressing keybindings instead of editing the rc.xml file.
I tried it and it did the trick!
You can check it there: http://code.google.com/p/obkey/. It does not need installation, just extract it and execute the obkey file.
Thanks for this howto.
I really like the simplicity and directness of openbox, now that I have it running - much more than I ever expected. I like the mint Julia default desktop a lot as well, wouldn't like to say which of the two I prefer just now ... :)
There are countless ways you could set up Openbox
That's one great thing about Openbox. You have covered briefly all the basic staff.
Basically complete. If there's any confusion or more detail is requested on specific parts then I'll be happy to try to clarify or elaborate. I hope some people can make use of this.
Nice, but if you are aiming this at LMDE users, you might want to include that in the title?
Looks a lot like setting up a basic CrunchBang like system...