Difficulty Level: a bit advanced, you should at least be comfortable with editing config files manually.
This was done on Ubuntu 14.04 but should work in a similar fashion in other *buntus or Linux distros.
While I really like Unity on my desktop computer, it is a bit heavy on the netbook. So I was looking for an alternative. Xfce and LXDE are cool but they bring a lot of applications that I don’t like or want. The solution to the problem is a window manager. In contrast to a desktop environment a window manager contains just the “frames” for the applications but in itself no applications.
My window manager of choice is Openbox, it’s small, it’s light and it comes with nothing, logging into a new Openbox session you end up with an empty desktop with no clock, no taskbar, no widgets, there is just the menu, called root menu.
That is not very cool, huh? Well, actually, it is pretty cool, cause you can add the missing components yourself. Making your desktop your living room and creating your own desktop environment from the components you prefer. And Openbox can look pretty cool, if you look at distributions such as Crunchbang.
My netbook is an Acer 1215b EeePC with an 1.65 GHz AMD APU, 6 GB of RAM, a 500 GB HDD and a 1366×768 display. It connects to the internet via a Huawei surfstick. So that is the setup I designed my own “desktop environment” for.
Note: If not otherwise mentioned, packages were installed from official repo.
What is Openbox?
As said, Openbox gives you just the “frames” to your applications, so an application in an Openbox desktop will have the buttons to close and minimize them in a title bar and they will be drawn over each other and placed on different workspaces. It offers you the possibility to add shortcuts to various actions. And you can apply themes to the windows. Openbox also has something like a start menu which is completely customizable.
Customization in Openbox is done via three simple text files, one controls the window layout, mouse actions and shortcuts (rc.xml), one the menu (menu.xml) and and the last one the autostart applications (simply autostart). You find example files in /etc/xdg/openbox/, copy these files to .config/openbox/ in your home directory to edit them.
rc.xml and menu.xml are (surprise) XML files, so if you know other XML based config files or a little (X)HTML, the syntax should be clear. Have a look at the examples in the default file, they are very helpful.
The autostart is basically a shell script that contains the packages and scripts you want to load/execute on login, which can be virtually everything. The syntax is so, that the script just fires up the commands virtually at the same time (the &
in the end), so you have to be careful to not execute too many commands at the same time, so best combine them with a delay (sleep
command), if they do not play nice.
You also get some GUI apps to adjust some settings, obconf controls the appearance and obmenu the menu entries (however, I didn’t get obmenu to work on Trusty on two systems). There is also obkeys available on GitHub to adjust the shortcuts. However, I preferred to edit the text files directly.
While you can already get pretty far with that, you can add more layout and functions to it.
How to make Openbox be cool?
My “BoxBuntu” setup with tint2, conky, and tilda. I use Dorian Dark 3.10 (GTK) and Dorian Neon (Openbox) theme, zoncolorDarkGrey icons, PolarCursorTheme-Blue and my favorite Lykke Li wallpaper.
A Composite Manager
First you should add a composite manager. On Unity that is done by compiz but that is pretty heavy, using quickly a few hundred MB, we don’t want that. A lighter approach is Compoton (later versions available from ppa:richardgv/compton), a fork of xcompmgr. With Compton you can add real transparency and shadows. You can simply add compton to the beginning of your autostart file
# Start composite manager
compton -b &
There is also a configuration tool available called compton-conf (you can get it at ppa:joern-schoenyan/lxqt). Changes done via compton-conf won’t be visiable until you restarted the session (log in and out).
A Taskbar
tint2 with two workspace, one running Pale Moon (active) the other one DeaDBeeF (inactive), a system tray and a clock
Next thing to add is a taskbar, I installed
tint2. It’s also a very light application, that can, besides the taskbar also work as a workspace switcher/pager, system tray and clock. tint2 is like Openbox controlled via a simple text file and you can adjust virtually everything. To start it, you simply have to add it to your autostart file.
## add the taskbar
tint2 &
I have grabbed the latest version from vivid repo, since it addresses a few bugs. Sometimes tint2 doesn’t play nice with the composite manager, if you have that problem, add a short delay like
## add the taskbar
(sleep 10 && tint2) &
If you want something more advanced you might want to try Xfce4-panel or lxpanel but I find tint2 pretty charming.
An Application Launcher
Trying to launch Pale Moon in gmrun
A very simple one is
gmrun. It basically does the same as ALT+F2 in Unity. It’s main features are a history and autocompletion via TAB. You can add it as a run dialog to the menu and map it to ALT+F2 (I have it at WIN+Space) in rc.xml. There is no need to add it to autostart, it starts, when it is needed
<keybind key="W-space">
<!-- <keybind key="A-F2">-->
<action name="Execute">
<command>gmrun</command>
</action>
</keybind>
I have also added the following to the applications section to make gmrun be always on top and to not appear in the taskbar.
<application name="gmrun">
<layer>above</layer>
<focus>yes</focus>
<skip_pager>yes</skip_pager>
<skip_taskbar>yes</skip_taskbar>
</application>
A Start Menu
Launching applications using openbox-menu
While I am usually using gmrun to launch applications, I sometimes like to have a start menu, that can be created using so called pipe menus in your Openbox menu with the commands
openbox-xdgmenu or
openbox-menu, the difference is that openbox-menu can do icons but that is fairly slow on a week machine like my netbook, without the icons I don’t see a difference. Try both of them and see what works best, just add it to your menu.xml.
<menu id="desktop-app-menu"
label="All Applications"
execute="openbox-xdgmenu /etc/xdg/menus/gnome-applications.menu" />
A Screensaver
Well, actually, nobody needs a screensaver these days but what we need is lock for the screen when we are not there. Since it is already on board you can use gnome-screensaver by simply adding it to your autostart file. But that alone does nothing. You also have to enable it, this can be done in multiple ways. One is a shortcut, so map something like WIN+L to gnome-screensaver-command --lock
.
<keybind key="W-l">
<action name="Execute">>
<command>gnome-screensaver-command --lock</command>
</action>
</keybind>
But that requires you to do something, you can also add autolocking. That is done through xautolock. To enable that, you have to put it in your autostart.
# Start screensaver
gnome-screensaver &
# enable autolock
xautolock -time 3 -locker "gnome-screensaver-command --lock" -corners +0-0 -cornerdelay 5 -cornerredelay 5 -detectsleep -secure &
The -corners
part activate or inhibit the screenlock by placing the cursor in the corners of your screen (see man xautolock
for details). In the example I use 3 minutes of inactivity to lock the screen, the active corner are left (top to lock after a few seconds, bottom to inhibit locking).
In one of the next posts I will show you something that looks more elegant and provides more functions (locking the screen, shutting off the display, inhibit screen lock when media players are running, etc.).
EDIT: How to build a kick-ass screen saver/lock for Openbox
A Logout Dialog
lxsession-logout dialog box
You will notice that by default, there is no grapical way to log out of your Openbox session. this can be done using
lxsession-logout. Add it to your your menu and/or map it to your power button (the latter might be a little tricky), for
me this worked
<keybind key="XF86PowerOff">
<action name="Execute">
<startupnotify>
<enabled>true</enabled>
<name>Logout</name>
</startupnotify>
<command>lxsession-logout --prompt="Leave BoxBuntu?"</command>
</action>
</keybind>
A System Monitor
While not absolutely necessary, it is nice to have, my choice is conky, it will also benefit from Compton, if you add transparency. conky is in fact a topic for itself, or simply look around, there are a lot of conky configurations available, use them or adjust them to your liking.
Conky displaying some system info
In case these is interest I can also upload my conky configuration file.
A Battery Indicator
For mobile computers it is absoluty necessary to know how much power is left. You can add that function to conky but conky gets hidden by other apps, Would be cool to have an indicator in the system tray, you can do that by installing XFCE4-power-manager. I would have preferred to use gnome-power-manager but didn’t manage to get it working.
Wallpapers
What is a desktop without a wallpaper? Right, boring. To manage wallpapers, we can make use of Nitrogen, it’s a very simple wallpaper manager and perfectly fine for a lightweight desktop. Nitrogen needs to be added to your autostart files. All you can do is specify folders and select wallpapers from them. You can also make it restore your previous wallpaper by adding it to your autostart file.
# add wallpaper
nitrogen --restore &
To change the wallpapers you can use the Nitrogen dialog
Nitrogen with the official Ubuntu wallpapers of the last couple of years
You could also use feh, it is described in many tutorials, but I find Nitrogen easier to use.
EDIT: if you want something more advanced, try my wallpaper randomizer based on Nitrogen.
Some Tweaks
One really cool tweak is unclutter. unclutter hides your cursor after a certain period of time, so it wont disturb while you are reading or typing. As soon as you use the mouse or touchpad it reappears. It just has to be added to autostart
# Hide mouse pointer
unclutter -idle 10 -root -jitter 10 &
adjust the idle value to your liking.
In case you have problems with screen brightness, you an use xrandr to adjust it on login by adding it to your autostart
# adjust screen brightness
xrandr --output LVDS --set BACKLIGHT 3 &
You might want to adjust the BACKLIGHT value to your liking, 3 works nice for me.
Another great application is lxappearance, it is part of the LXDE project and allows you to easily change the GTK theme and the cursor theme. It nicely complements obconf and compton-conf.
Selecting an icon theme in lxappearance
Applications
- I use gedit as my text editor (enable pkexec for gedit). It is comparably heavy but we have saved enough power for it, and it is a pretty powerful tool. You could also go for Mousepad, if you want something lighter.
- Tilda and sakura are my terminal emulators. Tilda replaces Guake in this setup, its handling is pretty similar and Tilda is much smaller, also it plays well with Openbox (in contrast to Unity). You can install a more recent version from the vivid repo. And I simply like sakura, the handling is pretty sweet.
- My file manager is Nemo, it is also rather heavy. If you want to use it, install the version without Cinnamon dependencies. You can also use Nautilus (or whatever comes with your *buntu), GNOME Commander or Midnight Commander (I recommend to install the latter anyway).
- For package management, I recommend Synaptic (or use the terminal) because it is simple and easy to use.
- For clipboard management I use ClipIt, Diodon, Parcellite or many others would work as well, choose depending on your liking.
- As a music player I installed DeaDBeeF, I prefer Quod Libet on the desktop but DeaDBeeF is lighter and for mobile use perfectly fine. The collection of music is simply smaller.
DeaDBeeF in Openbox
- Pale Moon is my default web browser, it is overall a bit lighter than Firefox (not that it is really light, none of the larger browsers is, if you want something lighter try Midori). Also the icon fits my overall style better.
- Searchmonkey is used to search in files (
grep
-like), an alternative would be the also pretty light regexxer. Both have their benefits and weaknesses, choose what you like.
- To search files (
find
-like) I installed catfish.
- To compare files Meld works just fine.
That is the stuff I actually use on a regular basis. For videos (rarely watch them on the netbook) I use mpv, for office stuff I kept LibreOffice.
Themes used
I am using Dorian Theme 3.10 (with matching Openbox theme called dorian-neon) by Josh Brown (hellokitten/killhellokitty), zoncolorGreyDark icons by Zon Saja, PolarCursorTheme-Blue by Eric Matthews (ECHM) and the Ubuntu fonts. The overall color theme consists of black white and blue which are also present in conky and tint2 as well as the terminal emulators.. I also used the bluish tone for the shadow. I have also added some transparency to the titlebar, menus and inactive windows, the letter ones are also get dimed. The current wallpaper is Lykke Li (from a fashion campaign for Lykke Li & Other Stories, wallpaperized by me).
Links
Many tutorials are slightly outdated but you can still use parts of them.
Openbox
– The Openbox Wiki
– The Openbox configuration guide and Adding CrunchBang features in another distro on Crunchbang Wiki
– The Openbox article on Arch Wiki
– Install Openbox On Ubuntu 13.04 & 13.10 by Rob, got my basic setup there
– Openbox guide and Openbox FAQ from urukrama’s weblog
The tools
– for info on tint2 check the tint2 Wiki
– for info on conky check the conky documentation
Some Eye Candy
– Box Look is a nice source for stuff related to various window managers including Openbox.
– GNOME Look contains a lot of stuff for the GNOME based desktop, some themes include Openbox themes, cursors and wallpapers are universal.
– KDE Look same as above for KDE
Closing Words
That turned out to be a long one here but it was fun to write and at least I have a guide, if I should ever need to reinstall it. I have been using this setup for a couple of days now and it feels pretty good. RAM and CPU usage decreased notably, fan noise dropped, applications run faster. I still try to open Dash from time to time and look in the upper right corner for the clock. But one can get used to it. How much work is it? To get it running I think you might need a weekend, I needed four days (evenings) including writing this article and trying a couple of alternatives (and doing some scripting). If you want to try, start with the stuff from Rob’s tutorial (in the links) and replace the outdated stuff with my suggestions.
And if you tried, let me know and send screenshots :)