Use ObConf to Preview, Archive and Install Openbox Themes
ObConf is Openbox's graphical preferences manager, and --install will overwrite the desktop user's theme the moment you point it at an archive. You will finish able to launch it safely, point it at a particular configuration file, build a theme archive, and install an existing .obt archive. Examples use ObConf package version 1:2.0.4+git20150213-3build1 on Ubuntu.
The route
Jump straight to the step you need, or tick off Done means at the end.
Allow about fifteen minutes. You need a running graphical Openbox session for the preferences window. None of the normal commands need root. Nothing here edits system files, replaces a window manager or installs a theme without warning.
1. Check the installed command
Confirm the package and executable before opening a graphical tool. Both are ordinary, read-only commands:
$ dpkg-query -W -f='${Package} ${Version}\n' obconf
obconf 1:2.0.4+git20150213-3build1
$ command -v obconf
/usr/bin/obconf
The local manual describes ObConf as a preferences manager for Openbox version 3.0 and later, with documented syntax obconf [OPTIONS] [ARCHIVE.obt]. That optional archive argument is not a general file picker, it is specifically an Openbox theme archive ObConf can open as part of its own graphical workflow.
Checkpoint
If command -v obconf prints nothing, install the distribution package through your normal software-management process. Do not hand-copy a binary into /usr/bin.
2. Open ObConf in the graphical session
Run this as the desktop user whose Openbox settings you actually want to change:
$ obconf
The window should open on ObConf's preferences tabs. Run it from a text-only console, a remote shell with no display forwarding, or a service account, and GTK will report it cannot open the display. That is an environment problem, not evidence the package is missing.
Warning
Do not use sudo obconf to work around a display error. It can leave root owning files the GUI creates, and can apply changes to the wrong user's Openbox configuration entirely. Start the command inside the intended graphical login instead.
ObConf also documents --version. Run it inside the graphical session for the program's own version display:
$ obconf --version
This binary initialises GTK before it exits. Without a display it can print a GTK warning and return non-zero before ever showing the version, so use the dpkg-query check above when you need an unambiguous package version from a plain shell.
3. Select the configuration file deliberately
Use --config-file when ObConf needs to work with a particular Openbox configuration. Check the path exists first:
$ CONFIG_FILE="$HOME/.config/openbox/rc.xml"
$ test -r "$CONFIG_FILE" && echo "readable: $CONFIG_FILE"
readable: /home/you/.config/openbox/rc.xml
$ obconf --config-file "$CONFIG_FILE"
Replace /home/you with the real home directory, or leave the variable unset and use the path your own shell prints. That command assumes a per-user configuration; a system-wide example is /etc/xdg/openbox/rc.xml, but do not edit or overwrite it casually. Changing a file owned by root means inspecting it and backing it up first, and reaching for elevated privileges only for that specific file operation.
Checkpoint
Once the window opens, confirm you are looking at the intended user's settings before pressing Apply or Save. If the file is missing, create or select the configuration through your normal Openbox setup rather than guessing a replacement path.
4. Create an archive from a theme directory
--archive builds a theme archive from a supplied theme directory. Point it at the directory that actually holds the Openbox theme files, not the parent directory full of unrelated themes; the installed theme data normally ends in an openbox-3 directory:
$ THEME_DIR="/path/to/MyTheme/openbox-3"
$ test -d "$THEME_DIR" && echo "theme directory found"
theme directory found
$ obconf --archive "$THEME_DIR"
ObConf then uses its own graphical archive workflow to produce an .obt file. Output location and any confirmation prompts belong to this version's GUI, so do not script around an invented filename or default directory. Check the file manager or chooser afterwards, and confirm the archive is non-empty before copying it anywhere:
$ stat -c '%n %s bytes' "/path/to/MyTheme.obt"
/path/to/MyTheme.obt 12345 bytes
That number is only an example. Keep the original theme directory until the archive has been tested. If the archive turns out wrong, remove only the newly created .obt file after confirming its exact path, never the source theme directory as a shortcut.
5. Install an archive and keep a recovery path
--install installs a supplied archive and selects it, changing the desktop user's Openbox theme outright. Treat it as a configuration change, not a read-only test:
$ ARCHIVE="/path/to/MyTheme.obt"
$ test -r "$ARCHIVE" && stat -c '%n %s bytes' "$ARCHIVE"
/path/to/MyTheme.obt 12345 bytes
$ obconf --install "$ARCHIVE"
Warning
Do not run this against an archive from an untrusted source. An archive here is input to a desktop configuration tool, and a theme can change how your whole session looks and behaves. Keep a copy of the previous theme archive, or at least record its name, before installing the new one.
There is no documented command-line undo. To recover, reopen ObConf, select the previous theme in the theme controls and apply it again. If the GUI will not start after a bad selection, get back into the graphical session with the old archive on hand and restore the user's Openbox configuration from the backup you made earlier. Do not delete the entire Openbox configuration directory while troubleshooting.
6. Use the remaining options only when needed
--tab NUMBER asks ObConf to open on a particular tab, but the manual defines no stable name-to-number mapping, so use it only once you have confirmed the number for this build. A normal launch is easier to diagnose:
$ obconf
$ printf 'exit status: %s\n' "$?"
exit status: 0
A zero exit status only means the process completed, it does not prove a theme was selected or a display change took effect. Verify the result in the ObConf window and, if needed, restart or reload Openbox using the method your desktop setup documents. Avoid restarting the window manager mid-task unless your work is already saved.
Done means
- Confirmed the installed ObConf package and executable.
- Launched it as the intended desktop user with a working display.
- Used
--config-fileonly with a deliberate, checked path. - Created an archive from the theme directory itself and kept the source.
- Treated
--installas a configuration change with a recovery path. - Never used root to paper over a display problem or overwrite system configuration casually.