Software & Apps Linux 62 62 people found this article helpful How to Install and Configure Openbox Using Ubuntu Try out a more minimal approach to your Ubuntu desktop by Gary Newell Writer Gary Newell was a freelance contributor, application developer, and software tester with 20+ years in IT, working on Linux, UNIX, and Windows. our editorial process Gary Newell Updated on May 21, 2020 unsplash / Mock Up Photos Linux Switching from Windows Tweet Share Email Since 2017 the Ubuntu Linux distribution has used GNOME as the default desktop environment and in most cases, this is a perfectly usable user interface that integrates well with countless themes and plugins. Its modern design philosophy makes finding your apps simple, while keeping your desktop clean. Sometimes, though, if you have an older machine you will want something a little bit lighter and you might go for something like Xubuntu Linux which uses the XFCE desktop or even Lubuntu which uses the LXDE desktop. Some other distributions, such as 4M Linux, use much lighter window managers such as JWM or IceWM. There aren't any official flavors of Ubuntu that come with these as the default option. You can make something equally as lightweight by using the Openbox window manager. This is a fairly bare-bones window manager that you can build upon and customize as you so desire. Openbox is the ultimate canvas for making the desktop just what you want it to be. This guide shows you the basics of setting up Openbox within Ubuntu, how to alter the menus, how to add a dock, and how to set the wallpaper. As of Ubuntu 20.04 the Openbox menu configuration tool, obmenu, covered later in this guide was removed due to technical conflicts with other software. While it's still possible to install and use Openbox on Ubuntu, customizing the menus can only be done by editing more complex text files. Installing Openbox To install Openbox open a terminal window (Press CTRL, ALT, and T) at the same time or search for "TERM" within the dash, and select the icon. Type the following command: sudo apt install openbox obconf Click on the icon in the top right corner and then choose to log out. How to Switch to Openbox From the login screen, select your username, like you normally would. When the screen expands to let you enter your password, press the gear icon in the lower right of the screen. A dialog will open with the following options: OpenboxUbuntuUbuntu on Wayland Choose Openbox. Then, sign in like you normally would. The Default Openbox Screen The default Openbox screen is a fairly bland looking screen. Right-clicking on the desktop brings up a menu. At the moment that is all, there is to it. You can't really do much. To start the customization process bring up the menu and choose terminal. Change the Openbox Wallpaper Start by setting your display resolution. Chances are, Openbox didn't get it right to start with. Open a terminal window, and run the xrandr command to set the display resolution. xrandr -s 1920x1080 You can also include a monitor refresh rate in there to set a specific one. xrandr -s 1920x1080 -r 60 Next, create a folder for your wallpaper. mkdir ~/Pictures/wallpaper Copy some wallpaper images into the folder. If you want some new ideas, check out Unsplash. Everything on there is high resolution and completely free to use. The program that we will use to set the wallpaper background is called feh. To install feh run the following command: sudo apt install feh When the application has finished installing type the following command of setting the initial background. feh --bg-scale ~/Pictures/wallpaper/<nameofpicture> Replace the <nameofpicture> with the name of the image you wish to use as the background. At the moment this will only temporarily set the background. To set the background every time you log in you will need to create an autostart file as follows: cd ~/.configmkdir openboxcd openboxnano autostart First, add your xrandr command to the file, so Openbox automatically uses the correct resolution. Then, in the autostart file enter the following command: sh ~/.fehbg & The ampersand (&) is incredibly important as it runs the command in the background so do not miss it out. Altogether, it should look something like this: xrandr -s 1920x1080 -r 60sh ~/.fehbg & Add a Dock to Openbox While the desktop now looks a little bit nicer it would be good to have a way of launching applications. To do this you can install Cairo which is a fairly classy-looking dock. The first thing you need to do is install a compositing manager. Open up a terminal window and enter the following code: sudo apt install xcompmgr Now install Cairo as follows: sudo apt install cairo-dock Open the autostart file again by running the following command: nano ~/.config/openbox/autostart Add the following lines to the bottom of the file: xcompmgr &cairo-dock -o & You should be able to restart Openbox to make this work by typing the following command: openbox --reconfigure If the above command doesn't work log out and log back in again. A message may appear asking whether you wish to use OpenGL or not. Select yes to continue. The Cairo dock should now load and you should be able to access all of your applications. Right-click on the dock and choose the configuration option to play with the settings. A guide on Cairo is coming shortly. Adjusting the Right-Click Menu This is the part that no longer works on Ubuntu 20.04. The issue was caused by Ubuntu's switch to Python 3. The obmenu utility uses an outdated piece of software only compatible with Python 2. As a result, the Ubuntu developers didn't even add it to the 20.04 repositories. This may change sometime in the future. With the dock providing a decent menu the need for the context menu. For completeness though here is how to adjust the right-click menu. Open a terminal again and run the following commands: cp /var/lib/openbox/debian-menu.xml ~/.config/openbox/debian-menu.xmlcp /etc/X11/openbox/menu.xml ~/.config/openboxcp /etc/X11/openbox/rc.xml ~/.config/openboxopenbox --reconfigure Now when you right-click on the desktop you should see a new Debian menu with an applications folder which links to the applications installed on your system. Adjust the Menu Manually If you want to add your own menu entries you can use the graphical application called obmenu. Open a terminal and type the following: obmenu & A graphical utility will load. To add a new sub menu select where you want the sub menu to be in the list and select New Menu. You will be asked to enter a label. To add a link to a new application select the New Item. Enter a label (i.e. a name) and then enter the path to the command to execute. You can also press the button with three dots on it and navigate to the /usr/bin folder or indeed any other folder to find the file or program to run. To remove items select the item to remove and press the small black arrow to the right of the toolbar, and choose Remove. Finally, you can enter a separator by choosing where you want the separator to appear and selecting New Separator. Configuring Openbox Desktop Settings To adjust general desktop settings either right-click on the menu and choose obconf or enter the following in a terminal: obconf & The editor is split into a number of tabs as follows: ThemeAppearanceWindowsMove & ResizeMouseDesktopMarginsDock The theme window lets you adjust the look and feel of the windows within Openbox. There are a number of default themes but you can download and install some of your own. The appearance window lets you adjust settings such as font styles, sizes, whether windows can be maximized, minimized, behavior codified, closed, rolled up, and present on all desktops. The windows tab lets you see the behavior of windows. For example you can automatically focus on a window when the mouse hovers over it and you can set where to open new windows. The move & resize window lets you decide how close windows can get to other windows before there is some resistance and you can set whether to move applications to new desktops when they are moved off the edge of a screen. The mouse window lets you decide how windows get focus when the mouse hovers over them and also lets you decide how a double click affects a window. The desktop window lets you decide how many virtual desktops there are and how long a notification is shown stating that you are about to switch desktops. The margins window lets you specify a margin around the screen whereby a window cannot pass over them. The dock tab lets you control select settings for your dock. It's not referring to Cairo. Rather, these settings apply, should you choose to install a more traditional panel, like Tint2. Summary This document introduces you to the basic concepts of switching to Openbox. Another guide will be created to discuss the main settings files for Openbox and more customization options.