Openbox is a lightweight, next generation window manager for users who want a minimal enviroment for their Fedora desktop. It’s well known for its minimalistic appearance, low resource usage and the ability to run applications the way they were designed to work. Openbox is highly configurable. It allows you to change almost every aspect of how you interact with your desktop. This article covers a basic setup of Openbox on Fedora.
Installing Openbox in Fedora
This tutorial assumes you’re already working in a traditional desktop environment like GNOME or Plasma over the Wayland compositor. First, open a terminal and run the following command using sudo.
sudo dnf install openbox xbacklight feh conky xorg-x11-drv-libinput tint2 volumeicon xorg-x11-server-utils network-manager-applet
Curious about the packages this command installs? Here is the package-by-package breakdown.
- openbox is the main window manager package
- xbacklight is a utility to set laptop screen brightness
- feh is a utility to set a wallpaper for the desktop
- conky is a utility to display system information
- tint2 is a system panel/taskbar
- xorg-x11-drv-libinput is a driver that lets the system activate clicks on tap in a laptop touchpad
- volumeicon is a volume control for the system tray
- xorg-x11-server-utils provides the xinput tool
- network-manager-applet provides the nm-applet tool for the system tray
Once you install these packages, restart your computer. After the system restarts, choose your user name to login. Before you enter your password, click the gear icon to select the Openbox session. Then enter your password to start Openbox.
If you ever want to switch back, simply use this gear icon to return to the selection for your desired desktop session.
Using Openbox
The first time you login to your Openbox session, a mouse pointer appears over a black desktop. Don’t worry, this is the default look and feel of the desktop. First, right click your mouse to access a handy menu to launch your apps. You can use the shortcut Ctrl + Alt + LeftArrow / RightArrow to switch between four virtual screens.
If your laptop has a touchpad, you may want to configure tap to click for an improved experience. Fedora features libinput to handle input from the touchpad. First, get a list or input devices in your computer:
$ xinput list ⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ ETPS/2 Elantech Touchpad id=11 [slave pointer (2)] ⎣ Virtual core keyboard id=3 [master keyboard (2)] ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] ↳ Power Button id=6 [slave keyboard (3)] ↳ Video Bus id=7 [slave keyboard (3)] ↳ Power Button id=8 [slave keyboard (3)] ↳ WebCam SC-13HDL11939N: WebCam S id=9 [slave keyboard (3)] ↳ AT Translated Set 2 keyboard id=10 [slave keyboard (3)]
In the example laptop, the touchpad is the device with ID 11. With this info you can list your trackpad properties:
$ xinput list-props 11 Device 'ETPS/2 Elantech Touchpad': Device Enabled (141): 1 Coordinate Transformation Matrix (143): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000 libinput Tapping Enabled (278): 0 libinput Tapping Enabled Default (279): 0 droped
In this example, the touchpad has the Tapping Enabled property set to false (0).
Now you know your trackpad device ID (11) and the property to configure (278). This means you can enable tapping with the command:
xinput set-prop <device> <property> <value>
For the example above:
xinput set-prop 11 278 1
You should now be able to successfully click in your touchpad with a tap. Now configure this option at the Openbox session start. First, create the config file with an editor:
vi ~/.config/openbox/autostart
This example uses the vi text editor, but you can use any editor you want, like gedit or kwrite. In this file add the following lines:
# Set tapping on touchpad on: xinput set-prop 11 278 1 &
Save the file, logout of the current session, and login again to verify your touchpad works.
Configuring the session
Here are some examples of how you can configure your Openbox session to your preferences. To use feh to set the desktop wallpaper at startup, just add these lines to your ~/.config/openbox/autostart file:
# Set desktop wallpaper: feh --bg-scale ~/path/to/wallpaper.png &
To use tint2 to show a task bar in the desktop, add these lines to the autostart file:
# Show system tray tint2 &
Add these lines to the autostart file to start conky when you login:
# Show system info conky &
Now you can add your own services to your Openbox session. Just add entries to your autostart file. For instance, add the NetworkManager applet and volume control with these lines:
#NetworkManager nm-applet & #Volume control in system tray volumeicon &
The configuration file used in this post for conky is available here you can copy and paste the configuration in a file called .conkyrc in your home directory .
The conky utility is a highly configurable way to show system information. You can set up a preferred profile of settings in a ~/.conkyrc file. Here’s an example conkyrc file. You can find many more on the web.
You are now able to customize your Openbox installation in exciting ways. Here’s a screenshot of the author’s Openbox desktop:
Configuring tint2
You can also configure the look and feel of the panel with tint2. The configuration file is available in ~/.config/tint2/tint2rc. Use your favorite editor to open this file:
vi ~/.config/tint2/tint2rc
Look for these lines first:
#------------------------------------- #Panel panel_items = LTSCB
These are the elements than will be included in the bar where:
- L = Launchers
- T = Task bar
- S = Systray
- C = Clock
- B = Battery
Then look for those lines to configure the launchers in the task bar:
#------------------------------------- #Launcher launcher_padding = 2 4 2 launcher_background_id = 0 launcher_icon_background_id = 0 launcher_icon_size = 24 launcher_icon_asb = 100 0 0 launcher_icon_theme_override = 0 startup_notifications = 1 launcher_tooltip = 1 launcher_item_app = /usr/share/applications/tint2conf.desktop launcher_item_app = /usr/local/share/applications/tint2conf.desktop launcher_item_app = /usr/share/applications/firefox.desktop launcher_item_app = /usr/share/applications/iceweasel.desktop launcher_item_app = /usr/share/applications/chromium-browser.desktop launcher_item_app = /usr/share/applications/google-chrome.desktop
Here you can add shortcuts to your favorite launcher_item_app elements. This item accepts .desktop files and not executables. You can get a list of your system-wide desktop files with this command:
ls /usr/share/applications/
As an exercise for the reader, see if you can find and install a theme for either the Openbox window manager or tint2. Enjoy getting started with Openbox as a Fedora desktop.
Joao Rodrigues
Hello,
What about keyboard shortcuts? Does Openbox use the same shortcuts as Gnome?
I frequently use Ctrl+Alt+Direction to change Virtual Desktop or Ctrl+Alt+Shift+Direction to move the active window to another Virtual Desktop. Other shortcut that I use is Super+Direction to Maximize, Un-maximize, maximize to half left and maximize to half right.
William Moreno
The shortcut to swicth virtual desktops works by default as spected in OpenBox, I will take a look at the others ones you point to see if there is a way to make in work in this window manager.
Joao Rodrigues
Found a post where you configure keybindings to resize to half-screen (and quarter-screen) but it relies a fixed display resolution (so it won’t work if you connect to an external display with different resolution)
https://bbs.archlinux.org/viewtopic.php?pid=732569#p732569
ferdnyc
The official docs say that for MoveResizeTo action arguments like width and height, “You may also specify the {width,height} as a fraction or a percentage, eg 50% or 7/8.” That may allow it to dynamically configure to different screen sizes.
http://openbox.org/wiki/Help:Actions#Resize
xmetax
The Openbox default keybinds for this are Shift + Alt + Direction. You can easily add your own keybinds in the $HOME/.config/openbox/rc.xml file. In case it wasn’t created automatically you may copy the /etc/xdg/openbox/rc.xml to $HOME/.config/openbox/ and use it as a template for your user specific customization.
I found this resource very valuable when learning the Openbox way.
Enjoy!
xmetax
https://wiki.archlinux.org/index.php/openbox
Striker
So, this worked pretty well and is only using 186 MiB of RAM. However, I installed under a fresh minimal install of Fedora 27, so adding packages like sddm (personal preference) and xterm were needed. Afterwards, I had to run ‘systemctl set-default graphical.target’ and ‘systemctl enable sddm’. I also had to add a user with useradd and set a password with passwd. Afterwards, rebooting shows the login screen.
William Moreno
Yes, the post assumes you have a active graphical session like Gnome (aka Workstation) or Plasma (aka KDE), nice to know that you were able to setup a working minimal desktop enviroment over your minimal fresh install and thank a lot to share the aditional steps you need to make it works.
Rene Reichenbach
@William Moreno may update your profile as “recently installed fedora 15” sounds not up to date 🙂
pbuurns
Install obconf, it’s pretty handy for some settings, like fonts, themes etc.
Joe Micciche
Dunst is a lightweight method for displaying system notifications with Openbox: https://github.com/dunst-project/dunst
It’s available in the Fedora repos – dunst.x86_64 : Simple and configurable notification-daemon
Morten Juhl-Johansen Zölde-Fejér
This is interesting, I have used Openbox for years and never came across this.
William Moreno
Nice to know about it, thanks!
LD
There seems to be a typo in the title, windows manager should be window manager.
Morten Juhl-Johansen Zölde-Fejér
I use Openbox and Gnome on my machine. My regular season is pretty much default Workstation with the Arc theme. When I want to play a game with Wine, I switch to an Openbox session with X.
To make the look more consistent, I have installed Obconf to do settings – and the Arc theme for Openbox:
https://github.com/dglava/arc-openbox
That makes for a good setup.
Also, I edit the rc.xml file for my keyboard shortcut settings. If you look for the section, you can see how it works.
I am used to do Alt-F2 for a runbox, so I install dmenu and set Alt-F2 to execute dmenu_run. Once you have s runbox, everything is available!
dextre
I hope fedora gets an openbox flavor
Daniel
Hey,
Thanks for the turtorial! Does anyone know how to configure this for a hidpi laptop screen? I have only found configs using xrandr which I assume don’t work on Wayland?
Thanks!
ferdnyc
This is kind of a weird time to be pushing OpenBox, since (as people are discovering in the comments) it’s kind of an orphaned project. The version that’s currently in Fedora, 3.6.1, was released on June 1, 2015, and that’s also the last time the source code was touched at all.
(See http://git.openbox.org/?p=mikachu/openbox.git;a=summary or the project wiki at http://openbox.org/wiki/Openbox:Download )
OpenBox users like to say that it’s “feature complete” and doesn’t need any development, but the fact is that it has not kept up with recent developments in the Linux desktop world.
There is absolutely no Wayland code in OpenBox. (I don’t know how it even runs under Wayland, if it does I’m guessing it’s using the Xwayland compatibility layer?)
There is absolutely no HiDPI support in OpenBox. (There are some workarounds, as Daniel mentioned, but they tend to leverage X11-specific things like XRandR. Regardless, without direct support in the OpenBox code itself they will always be imperfect hacks.)
Most projects that have relied on OpenBox are looking for a path away from it, at this point, because they want to move onto modern technologies like Wayland and OpenBox isn’t prepared to come along for the ride. (Sway seems to get a lot of attention, as a potential replacement. http://swaywm.org/ )
David
These articles are terrific. Keep em coming! Also, love the simple layout of the website.