How to install and configure Openbox, a windows environment for hackers

by-web development

OpenBox is a very lightweight and easy to hack desktop environment for Linux.

Major distributions are usually shipped using Gnome or KDE, and now Ubuntu is shipped with Unity, but I’m sure you’ll find an Openbox package in your distribution repos.

There is even a Ubuntu base distro shipped with a tweacked OpenBox with default: http://wiki.lxde.org/en/Main_Page.

I’ve never really tried it as the default apps installed and the default there do not appeal me, but if you need to install something on a light computer or a netbook, it might be a good option.

Why do I love Openbox so much?

I’ve been a Linux user for a long time and as far as I can remember, I’ve always hated KDE. Too much “stuff”, too much bling-bling and too much mouse usage.

Before falling in love with OpenBox, I was using Gnome. I liked its simplicity but found that I still had to use the mouse too much.

Unfortunately all good things end. Now Gnome 3.0 is in the pipeline and Unity is mainstream.

I don’t dislike these projects and, to be fair, Unity is pretty good for a “normal user”. Nice, polished (as much as it can be for a first version), easy to use, and we can see that Windows 8 and Unity tend, to a certain extent, to remove the gap between mouse and fingers (touch) for the future.

But I don’t find Unity (or gnome 3 or Mac OS) good enough for daily development tasks. I’d rather lose the eye candy and have a super fast, solid, tweackable window Manager.

Again, I’m not saying than Openbox is for everyone, but if you’re a serious hacker, you should give it a go. I’m sure you’ll love it!

I discovered Openbox with Arch Linux about a year ago. Even if I’ve now abandoned Arch Linux on my development machine (back to Ubuntu) I have kept Openbox: easy to use, 0 bling bling, everything accessible via shortcuts, and the smallest memory footprint you can find.

From time to time I boot to Gnome or Unity, just to be sure that I don’t miss anything. But usually, after 15 minutes I am back onto my minimal setup. Blazzing fast! This is what I’m missing with the other ones.

OpenBox feels like a developer’s dream to work on.

What should I expect after an initial Openbox setup?

openbox_1st

Well, barely nothing if you don’t have what you need. Openbox is just a minimal window manager, so there won’t be any panels, background manager, launcher or anything. So basically the first time you launch OpenBox you’ll have nothing but a black background and a right-click mouse menu to launch applications.

But once the setup is finished, you have a super fast working environement, with multidesktops, a background manager, super shortcuts, launcher(s), and a minimal memory footprint.

Please let me drive you to this wonderful world of Openbox installation and customization…

Installation

Installing Openbox is super easy. I assume here that you use a Debian base distribution. If you don’t, just replace apt-get install by your favourite package manager.
1. OpenBox and Obconf
OpenBox manager makes it easy to change the number of virtual desktops, names and themes.

Openbox Configuration Manager_009

sudo apt-get install openbox obconf

You are now done. If you logout and login choosing the Openbox session, you should now come to a very empty screen.

Right click on the desktop to get to the menu and access applications.

2. Tint2
Tint2 it the bar that includes Systray, a windows list, clock and all that jazz. Easily customisable, it’s really lightweight and supports dual screens the way you choose (active on both screen or only 1 of them).

tint2_003

sudo apt-get install tint2

To change the Tint2 config, you can update the Tint2rc file, or use tint2wizard.

3. Compositing
In order to have transparency, you need to install (and run) a composite manager.

I like xcompmgr because it’s lightweight. People who want more effect will prefer cairo-compmgr. It’s up to you.

sudo apt-get xcompmgr
4. Docky

This is the Mac OS dock replica. I like to have one of those for quick access to windows and widgets.

docky

sudo apt-get install docky
5. Application launcher (synapse & gmrun)

Synapse is a quick launcher bar and gmrun is a quick command bar. Both are useful to have for applications that you don’t use everyday or if you don’t want your dock to be crowded with too many icons.

synapse_005

 

Execute program feat. completion_006

sudo apt-get install synapse gmrun
6. File management

Some prefer to stay with Nautilus, some move to PacFm. I’m personally a big fan of Thunar.

nicolas - File Manager_008

sudo apt-get install thunar thunar-thumbnailers thunar-archive-plugin thunar-media-tags-plugin
7. Background

In order to have background images, I’ve choosen Nitrogen. Simple, effective and compatible with a dual monitor.

Nitrogen_002

sudo apt-get install nitrogen
8. Copy paste clippings

Parcellite is quite good for that

sudo apt-get install parcellite
9. Tiling

Pytyle2 provides a very good solution if you want pseudo tiling on your desktop.

Doc_010

View Pytyle2 webpage and install instructions

Install everything in one go

If you want to install all those softwares in one go:

sudo apt-get install openbox obconf obmenu gmrun synapse docky nitrogen tint2 xcompgmr thunar thunar-thumbnailers thunar-archive-plugin thunar-media-tags-plugin parcellite

Configuration

The beauty of OpenBox resides in its mimimal configuration. You only have a few important files.

1. For Openbox

~/.config/openbox/rc.xml _this is where you<span class="err">'</span>ll manager your shortcuts_
~/.config.openbox/autostart.sh _list of application to start on login_
~/.config/openbox/menu.xml _menu list <span class="k">for </span>the right click_

Themes

Themes are stored in

~/.themes/

All those file are really easy to configure. Just open them and you’ll find help at the top.

To change a window behaviour or config (like theme), I use obconf.

I usually don’t bother too much about the menu as I launch everyhing using shortcuts or Synapse. But if you really want to use this menu, you’ll find on Google some easy way to update it with what you have in your Gnome menu for example.

2. For Tint2

~/.config/openbox/tint2/tint2rc

Regarding Tint2, I think the easiest way to configure it is to use http://code.google.com/p/tintwizard/

3. For Pytytle2

~/.config/pytyle2/config.ini
4. For Nautilus

Nautilus is responsible for the desktop background in Gnome, so you need to disable this feature with the following 2 commands:

gconftool-2 -s -t bool /apps/nautilus/preferences/show_desktop <span class="nb">false</span> &
gconftool-2 -s -t bool /desktop/gnome/background/draw_background <span class="nb">false</span> &

If you want to enable this feature again (because you want to go back to Gnome, and want the desktop background) just change false to true.

This it it!

5. My config
You can find here my config files on my github

Just copy the files in the right location, logout and login again with Openbox this time (small select box on the bottom)

6. My shortcuts
Shortcuts that I use all the time

W = Windows Key C = Control Key A = Shift A = Alt Key

  • C + A + Up: Toggle maximize, remove decorations on window
  • C + A + Down: Minimize window
  • C + A + Left: Move to left virtual desktop
  • C + A + Right: Move to right virtual desktop
  • C + S + left/right: Move active window to left/right virtual desktop
  • W + left/right: Move window to left/right monitor (only with dual monitor)
  • W + S + up/down/left/right: Grow to edge up/down/left/right (pseudo tilling)
  • Button 2 on tint2 window: Close the window
  • W + T: Open gnome-terminal
  • W + G: Open Google Chrome
  • W + B: Open Firefox
  • W + F: Open Thunar file manager
  • C + Space: Launch synapse
  • C + A + Space: Launch Gmrun
  • Alt + A: Active tilling on desktop
  • A + U: Deactivate tilling
  • A + C: Cycle master tilled window
  • A + L or H: Expand/Reduce master tilled window
  • A + K/J: Focus next/previous tilled window
Screencast
A quick screencast giving you a glimpse of what you can have by following this tutorial.

[youtube src="http://www.youtube.com/embed/vwjSog0V7ZE"]

Final word

I hope I gave you the OpenBox bug. I think it’s one of the best Linux environment to work on.

Let me know if it inspired you or if I can help you to set up anything.

Thanks for reading. To continue the discussion contact me: or

Do you need a team to build your web/mobile app? Are you looking for some great Ruby on Rails developers?
Send us an email now at hello@cookieshq.co.uk

Related posts