https://wiki.archlinux.org/api.php?action=feedcontributions&user=Akleop&feedformat=atomArchWiki - User contributions [en]2024-03-28T15:13:19ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Openbox&diff=433172Openbox2016-04-29T17:09:11Z<p>Akleop: Undo revision 433171 by Akleop (talk)</p>
<hr />
<div>[[Category:Stacking WMs]]<br />
[[cs:Openbox]]<br />
[[de:Openbox]]<br />
[[el:Openbox]]<br />
[[es:Openbox]]<br />
[[fr:Openbox]]<br />
[[it:Openbox]]<br />
[[ja:Openbox]]<br />
[[ko:Openbox]]<br />
[[lt:Openbox]]<br />
[[nl:Openbox]]<br />
[[pl:Openbox]]<br />
[[ru:Openbox]]<br />
[[sk:Openbox]]<br />
[[sr:Openbox]]<br />
[[tr:Openbox]]<br />
[[zh-CN:Openbox]]<br />
[[zh-TW:Openbox]]<br />
{{Related articles start}}<br />
{{Related|Desktop environment}}<br />
{{Related|Display manager}}<br />
{{Related|File manager functionality}}<br />
{{Related|Window manager}}<br />
{{Related|Oblogout}}<br />
{{Related|Xdg-menu}}<br />
{{Related articles end}}<br />
<br />
Openbox is a lightweight, powerful, and highly configurable ''stacking'' [[window manager]] with extensive standards support. It may be built upon and run independently as the basis of a unique [[desktop environment]], or within other integrated desktop environments such as [[KDE]] and [[Xfce]], as an alternative to the window managers they provide. The [[LXDE]] desktop environment is itself built around Openbox.<br />
<br />
A comprehensive list of features are documented at the [http://openbox.org/ official Openbox website]. This article pertains to specifically installing Openbox under Arch Linux.<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|openbox}} package.<br />
<br />
=== Standalone ===<br />
<br />
[[Display manager]]s will automatically detect Openbox, allowing for it to be run as a standalone session.<br />
<br />
To start openbox with [[Xinitrc]], add the following line:<br />
<br />
exec openbox-session<br />
<br />
{{Note|Specifying {{ic|openbox}} instead of {{ic|openbox-session}} will prevent [[#autostart|autostart]] in {{ic|/etc/xdg/autostart}}.}}<br />
<br />
=== Other desktop environments ===<br />
<br />
{{Note|<br />
* When replacing the native window manager of a [[desktop environment]] with Openbox, keep in mind that Openbox does not provide any compositing effects (such as transparency). See [[#Compositing effects]].<br />
* Openbox does work with GNOME applications (but see [[GTK+#Client-side decorations]]). [http://comments.gmane.org/gmane.comp.window-managers.openbox/6595]}}<br />
<br />
See [[Desktop environment#Custom window manager]].<br />
<br />
== Configuration==<br />
<br />
{{Note|Local configuration files will always override global equivalents.}}<br />
<br />
Four key files form the basis of the openbox configuration, each serving a unique role. They are: {{ic|rc.xml}}, {{ic|menu.xml}}, {{ic|autostart}}, and {{ic|environment}}. Although these files are discussed in more detail below, to start configuring Openbox, it will first be necessary to create a '''local''' Openbox profile (i.e for your specific user account) based on them. This can be done by copying them from the '''global''' {{ic|/etc/xdg/openbox}} profile (applicable to any and all users) as a template:<br />
<br />
$ cp -R /etc/xdg/openbox ~/.config/<br />
<br />
=== rc.xml ===<br />
<br />
{{Tip|Custom keyboard shortcuts (keybindings) must be added to the {{ic|<keyboard>}} section of this file, and underneath the {{ic|<nowiki><!-- Keybindings for running aplications --></nowiki>}} heading.}}<br />
<br />
{{ic|~/.config/openbox/rc.xml}} is the main configuration file, responsible for determining the behaviour and settings of the overall session, including:<br />
<br />
* Keyboard shortcuts (e.g. starting applications; controlling the volume)<br />
* Theming<br />
* Desktop and Virtual desktop settings, and<br />
* Application Window settings<br />
<br />
This file is also pre-configured, meaning that it will only be necessary to amend existing content in order to customise behaviour to suit personal preference.<br />
<br />
{{Note|Per-application settings pertaining to fixed placement of applications per monitor will only work if the x & y position have also been defined.}}<br />
<br />
=== menu.xml ===<br />
<br />
{{ic|~/.config/openbox/menu.xml}} defines the type and behaviour of the desktop menu, accessable by right-clicking the background. Although the default provided is a '''static menu''' (meaning that it will not automatically update when new applications are installed), it is possible to employ the use of '''dynamic menus''' that will automatically update as well. <br />
<br />
The available options are discussed extensively below in the [[#Menus|Menus]] section.<br />
<br />
=== autostart ===<br />
<br />
The file {{ic|~/.config/openbox/autostart}}, if present, is executed by Openbox at startup. A basic example of this file consists of one command per line, like so:<br />
<br />
xset -b<br />
nm-applet &<br />
conky &<br />
<br />
Note that a single ampersand ({{ic|&}}) causes the process in question to be run in the background, allowing the script to continue on to the next command. An ampersand is therefore needed after each command that launches a process of indefinite duration. Commands that are completed essentially instantly (e.g. {{ic|xset -b}}) may be left alone.<br />
<br />
Issues regarding commands in {{ic|~/.config/openbox/autostart}} being executed out of order (or skipped altogether) are often resolved by the addition of small delays. For instance:<br />
<br />
xset -b<br />
(sleep 3s && nm-applet) &<br />
(sleep 3s && conky) &<br />
<br />
{{Note|In addition to running {{ic|~/.config/openbox/autostart}}, Openbox will also launch programs with {{ic|.desktop}} files present in {{ic|/etc/xdg/autostart}}. This is the global [[autostart]] directory, which is automatically sourced by XDG-compliant desktop environments (e.g. GNOME, KDE). Openbox will source this directory as well, provided that the package {{Pkg|python2-xdg}} is installed, and Openbox is launched as {{ic|openbox-session}} (rather than simply {{ic|openbox}}, as [[#Standalone|noted earlier]]). Duplication between {{ic|~/.config/openbox/autostart}} and {{ic|/etc/xdg/autostart}} is a common cause of programs launching twice at startup (e.g. two network manager tray icons).}}<br />
<br />
The {{ic|/usr/lib/openbox/openbox-xdg-autostart}} python2 script runs applications based on the XDG autostart specification.<br />
<br />
=== environment ===<br />
<br />
{{ic|~/.config/openbox/environment}} can be used to export and set relevant environmental variables such as to:<br />
<br />
* Define new pathways (e.g. execute commands that would otherwise require the entire pathway to be listed with them)<br />
* Change language settings, and<br />
* Define other variables to be used (e.g. the fix for GTK theming could be listed here)<br />
<br />
=== GUI configuration ===<br />
<br />
Several GUI applications are available to quickly and easily configure your Openbox desktop. From the [[official repositories]]:<br />
<br />
* {{App|ObConf|A GTK2 based configuration tool for the Openbox window manager.|http://openbox.org/wiki/ObConf:About|{{Pkg|obconf}}}}<br />
* {{App|LXAppearance ObConf|Plugin for LXAppearance to configure Openbox. Note that not all options to configure Openbox are available in this plugin, so you might want to install obconf anyway.|http://lxde.org|{{Pkg|lxappearance-obconf}}}}<br />
* {{App|LXInput|LXDE keyboard and mouse configuration|http://lxde.org|{{Pkg|lxinput}}}}<br />
* {{App|LXRandR|LXDE monitor configuration.|http://wiki.lxde.org/en/LXRandR|{{Pkg|lxrandr}}}}<br />
* {{App|obkey|Configure Openbox keyboard shortcuts|https://code.google.com/p/obkey/|{{AUR|obkey}}}} <br />
* {{App|ob-autostart|A simple autostart application for Openbox.|http://pastebin.com/012YgXTk|{{AUR|ob-autostart}}}} <br />
<br />
Programs and applications relating to the configuration of Openbox's desktop menu are discussed in the [[#Menus|Menus]] section.<br />
<br />
== Openbox reconfiguration ==<br />
<br />
{{Tip|where not already present, it would be worthwhile adding this command to a menu and/or as a keybind for convenience.}}<br />
<br />
Openbox will not always automatically reflect any changes made to its configuration files within a session. As a consequence, it will be necessary to manually reload those files after they have been edited. To do so, enter the following command:<br />
<br />
$ openbox --reconfigure<br />
<br />
Where intending to add this command as a keybind to {{ic|~/.config/openbox/rc.xml}}, it will only be necessary to list the command as {{ic|reconfigure}}. An example has been provided below, using the {{ic|Super}}+{{ic|F11}} keybind:<br />
<br />
<keybind key="W-F11"><br />
<action name="Reconfigure"/><br />
</keybind><br />
<br />
== Keybinds ==<br />
<br />
All keybinds must be added to the {{ic|~/.config/openbox/rc.xml}} file, and below the {{ic|<nowiki><!-- Keybindings for running aplications --></nowiki>}} heading. Although a brief overview has been provided here, a more in-depth explanation of keybindings can be found at [http://openbox.org/wiki/Help:Bindings openbox.org]. {{AUR|obkey}} is a utility for adjust key-binding. Before using obkey, you should use obconf to create {{ic|~/.config/openbox/rc.xml}}.<br />
<br />
=== Special keys ===<br />
<br />
While the use of standard alpha-numeric keys for keybindings is self-explanatory, special names are assigned to other types of keys, such as {{ic|modifers}}, {{ic|multimedia}} keys and {{ic|navigation}} keys.<br />
<br />
==== Modifiers ====<br />
<br />
{{ic|Modifer}} keys play an important role in keybindings (e.g. holding down the {{ic|shift}} or {{ic|CTRL / control}} key in combination with another key to undertake an action). Using modifers helps to prevent conflicting keybinds, whereby two or more actions are linked to the same key or combination of keys. The syntax to use a modifer with another key is:<br />
<br />
"<modifier>-<key>"<br />
<br />
The modifer codes are as follows:<br />
<br />
* {{ic|S}}: Shift<br />
* {{ic|C}}: Control / CTRL<br />
* {{ic|A}}: Alt<br />
* {{ic|W}}: Super / Windows<br />
* {{ic|M}}: Meta<br />
* {{ic|H}}: Hyper (If it is bound to something) <br />
<br />
For example, the code below would use {{ic|super}} and {{ic|t}} to launch {{Pkg|lxterminal}}<br />
<br />
<keybind key="W-t"><br />
<action name="Execute"><br />
<command>lxterminal</command><br />
</action><br />
</keybind><br />
<br />
==== Multimedia keys ====<br />
<br />
{{Merge|Extra keyboard keys in Xorg}}<br />
<br />
Where available, it is possible to set the appropriate {{ic|multimedia}} keys to perform their intended functions, such as to control the volume and/or the screen brightness. These will usually be integrated into the {{ic|function}} keys, and are identified by their appropriate symbols. See [[Extra keyboard keys]] for details.<br />
<br />
The volume and brightness multimedia codes are as follows (note that commands will still have to be assigned to them to actually function):<br />
<br />
* {{ic|XF86AudioRaiseVolume}}: Increase volume<br />
* {{ic|XF86AudioLowerVolume}}: Decrease volume<br />
* {{ic|XF86AudioMute}}: Mute / unmute volume<br />
* {{ic|XF86MonBrightnessUp}}: Increase screen brightess<br />
* {{ic|XF86MonBrightnessDown}}: Decrease screen brightness<br />
<br />
Examples of how these may be used in {{ic|~/.config/openbox/rc.xml}} have been provided below.<br />
<br />
==== Navigation keys ====<br />
<br />
These are the directional / arrow keys, usually used to move the cursor up, down, left, or right. The (self-explanatory) navigation codes are as follows:<br />
<br />
* {{ic|Up}}: Up<br />
* {{ic|Down}}: Down<br />
* {{ic|Left}}: Left<br />
* {{ic|Right}}: Right<br />
<br />
=== Volume Control ===<br />
<br />
What commands should be used for controlling the volume will depend on whether [[ALSA]], [[PulseAudio]], or [[OSS]] is used for sound.<br />
<br />
==== ALSA ====<br />
<br />
If [[ALSA]] is used for sound, the {{ic|amixer}} program can be used to adjust the volume, which is part of the {{Pkg|alsa-utils}} package. The following example - using the {{ic|multimedia}} keys intended to control the volume - will adjust the volume by +/- 5% (which may be changed, as desired):<br />
<br />
<keybind key="XF86AudioRaiseVolume"><br />
<action name="Execute"><br />
<command>amixer set Master 5%+ unmute</command><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioLowerVolume"><br />
<action name="Execute"><br />
<command>amixer set Master 5%- unmute</command><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioMute"><br />
<action name="Execute"><br />
<command>amixer set Master toggle</command><br />
</action><br />
</keybind><br />
<br />
==== Pulseaudio ====<br />
<br />
Where using [[PulseAudio]] with [[ALSA]] as a backend, the {{ic|amixer}} program commands will have to be modifed, as illustrated below in comparison to the ALSA example:<br />
<br />
<keybind key="XF86AudioRaiseVolume"><br />
<action name="Execute"><br />
<command>amixer -D pulse set Master 5%+ unmute</command><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioLowerVolume"><br />
<action name="Execute"><br />
<command>amixer -D pulse set Master 5%- unmute</command><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioMute"><br />
<action name="Execute"><br />
<command>amixer -D pulse set Master toggle</command><br />
</action><br />
</keybind><br />
<br />
==== OSS ====<br />
<br />
{{Note|This option may be suitable for more experienced users.}}<br />
<br />
Where using [[OSS]], it is possible to create keybindings to raise or lower specific mixers. This allows, for example, the volume of a specific application (such as an audio player) to be changed without changing the overall system volume settings in turn. In this instance, the application must first have been [[OSS#Configuring_Applications_for_OSS|configured]] to use its own mixer. <br />
<br />
In the following example, [[MPD]] has been configured to use its own mixer - also named {{ic|mpd}} - to increase and decrease the volume by a single decibel at a time. The {{ic|--}} that appears after the {{ic|ossmix}} command has been added to prevent a negative value from being treated as an argument: <br />
<br />
<keybind key="[chosen keybind]"><br />
<action name="Execute"><br />
<command>ossmix -- mpd +1</command><br />
</action><br />
</keybind><br />
<keybind key="[chosen keybind]"><br />
<action name="Execute"><br />
<command>ossmix -- mpd -1</command><br />
</action><br />
</keybind><br />
<br />
=== Media player control ===<br />
<br />
The {{AUR|playerctl}} command-line utility can be used to bind multimedia keys to player actions. It should work with most media players.<br />
<br />
<keybind key="XF86AudioPlay"><br />
<action name="Execute"><br />
<command>playerctl play</command><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioPause"><br />
<action name="Execute"><br />
<command>playerctl pause</command><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioNext"><br />
<action name="Execute"><br />
<command>playerctl next</command><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioPrev"><br />
<action name="Execute"><br />
<command>playerctl previous</command><br />
</action><br />
</keybind><br />
<br />
=== Brightness control ===<br />
<br />
The {{ic|xbacklight}} program is used to control screen brightness, which is part of the [[Xorg]] X-Window system. In the example below, the {{ic|multimedia}} keys intended to control the screen brightness will adjust the settings by +/- 10%:<br />
<br />
<keybind key="XF86MonBrightnessUp"><br />
<action name="Execute"><br />
<command>xbacklight +10</command><br />
</action><br />
</keybind><br />
<keybind key="XF86MonBrightnessDown"><br />
<action name="Execute"><br />
<command>xbacklight -10</command><br />
</action><br />
</keybind><br />
<br />
=== Window snapping ===<br />
<br />
Many desktop environments and window managers support ''window snapping'' (e.g. Windows 7 Aero snap), whereby they will automatically snap into place when moved to the edge of the screen. This effect can also be simulated in Openbox through the use of keybinds on focused windows. <br />
<br />
As illustrated in the example below, percentages must be used to determine window sizes (see [http://openbox.org/wiki/Help:Actions openbox.org] for further information). In this instance, The {{ic|super}} key is used in conjunction with the {{ic|navigation}} keys:<br />
<br />
<keybind key="W-Left"><br />
<action name="UnmaximizeFull"/><br />
<action name="MaximizeVert"/><br />
<action name="MoveResizeTo"><br />
<width>50%</width><br />
</action><br />
<action name="MoveToEdge"><direction>west</direction></action><br />
</keybind><br />
<keybind key="W-Right"><br />
<action name="UnmaximizeFull"/><br />
<action name="MaximizeVert"/><br />
<action name="MoveResizeTo"><br />
<width>50%</width><br />
</action><br />
<action name="MoveToEdge"><direction>east</direction></action><br />
</keybind><br />
<br />
However, it should be noted that once a window has been 'snapped' to an edge, it will remain vertically maximised unless subsequently maximised and then restored. The solution is to implement additional keybinds - in this instance using the {{ic|down}} and {{ic|up}} keys - to do so. This will also make pulling 'snapped' windows from screen edges faster as well:<br />
<br />
<keybind key="W-Down"><br />
<action name="Unmaximize"/><br />
</keybind><br />
<keybind key="W-Up"><br />
<action name="Maximize"/><br />
</keybind><br />
<br />
This [http://ubuntuforums.org/showthread.php?t=1796793 Ubuntu forum thread] provides more information. Applications such as {{AUR|opensnap-git}} are also available to automatically simulate window snapping behaviour without the use of keybinds.<br />
<br />
=== Desktop menu ===<br />
<br />
It is also possible to create a keybind to access the desktop menu. For example, the following code will bring up the menu by pressing {{ic|CTRL}} + {{ic|m}}:<br />
<br />
<keybind key="C-m"><br />
<action name="ShowMenu"><br />
<menu>root-menu</menu><br />
</action><br />
</keybind><br />
<br />
== Menus ==<br />
<br />
It is possible to employ three types of menu in Openbox: {{ic|static}}, {{ic|pipes}} (dynamic), and {{ic|generators}} (static or dynamic). They may also be used alone or in any combination.<br />
<br />
=== Static ===<br />
<br />
As the name would suggest, this default type of menu does not change in any way, and may be manually edited and/or (re)generated automatically through the use on an appropriate software package.<br />
<br />
Fast and efficient, while this type of menu can be used to select applications, it can also be useful to access specific functions and/or perform specific tasks (e.g. desktop configuration), leaving the access of applications to another process (e.g. the {{Pkg|synapse}} or {{Pkg|xfce4-appfinder}} applications).<br />
<br />
The {{ic|~/.config/openbox/menu.xml}} file will be the sole source of static desktop menu content.<br />
<br />
==== menumaker ====<br />
<br />
{{Warning|A root terminal '''must''' be installed in order to use MenuMaker, even though a standard user terminal may be used to run it. {{Pkg|xterm}} is a good choice.}}<br />
<br />
{{Pkg|menumaker}} automatically generates {{ic|xml}} menus for several window managers, including Openbox, [[Fluxbox]], [[IceWM]] and [[Xfce]]. It will search for all installed executable programs and consequently create a menu file for them. It is also possible to configure MenuMaker to exclude certain application types (e.g. relating to [[GNOME]] or [[KDE]]), if desired.<br />
<br />
Once installed and executed, it will automatically generate a new {{ic|~/.config/openbox/menu.xml}} file. To avoid overwriting an existing file, enter:<br />
<br />
$ mmaker -v OpenBox3<br />
<br />
Otherwise, to overwrite an existing file, add the {{ic|force}} argument ({{ic|f}}):<br />
<br />
$ mmaker -vf OpenBox3<br />
<br />
Once a new {{ic|~/.config/openbox/menu.xml}} file has been generated it may then be manually edited, or configured using a GUI menu editor, such as {{Pkg|obmenu}}.<br />
<br />
==== obmenu ====<br />
<br />
{{Warning|{{ic|obm-xdg}} - a pipe menu to generate a list of [[GTK+]] and [[GNOME]] applications - is also provided with obmenu. However, it has long-running bugs whereby it may produce an invalid output, or even not function at all. Consequently it has been omitted from discussion.}}<br />
<br />
{{Pkg|obmenu}} is a "user-friendly" GUI application to edit {{ic|~/.config/openbox/menu.xml}}, without the need to code in {{ic|xml}}.<br />
<br />
==== xdg-menu ====<br />
<br />
{{Pkg|archlinux-xdg-menu}} will automatically generate a menu based on {{ic|xdg}} files contained within the {{ic|/etc/xdg/}} directory for numerous Window Managers, including Openbox. Review the [[Xdg-menu#OpenBox]] article for further information.<br />
<br />
==== logout menu options ====<br />
<br />
{{Tip|The commands provided can also be attached to [[#Keybinds|keybinds]].}}<br />
<br />
The {{ic|~/.config/openbox/menu.xml}} file can be edited in order to provide a sub-menu with the same options as provided by [[#oblogout|oblogout]]. The sample script below will provide all of these options, with the exception of the ability to lock the screen:<br />
<br />
<menu id="exit-menu" label="Exit"><br />
<item label="Log Out"><br />
<action name="Execute"><br />
<command>openbox --exit</command><br />
</action><br />
</item><br />
<item label="Shutdown"><br />
<action name="Execute"><br />
<command>systemctl poweroff</command><br />
</action><br />
</item><br />
<item label="Restart"><br />
<action name="Execute"><br />
<command>systemctl reboot</command><br />
</action><br />
</item><br />
<item label="Suspend"><br />
<action name="Execute"><br />
<command>systemctl suspend</command><br />
</action><br />
</item><br />
<item label="Hibernate"><br />
<action name="Execute"><br />
<command>systemctl hibernate</command><br />
</action><br />
</item><br />
</menu><br />
<br />
Once the entries have been composed, add the following line to present the sub-menu where desired within the main desktop menu (usually as the last entry):<br />
<br />
<menu id="exit-menu"/><br />
<br />
=== Pipes ===<br />
<br />
{{Tip|It is entirely feasible for a static menu to contain one or more pipe sub-menus. The functionality of some pipe menus may also rely on the installation of relevant software packages.}}<br />
<br />
This type of menu is in essence a script that provides dynamic, refreshed lists on-the-fly as and when run. These lists may be used for multiple purposes, including to list applications, to provide information, and to provide control functions. Pre-configured pipe menus can be installed, although not from the [[official repositories]]. More experienced users can also modify and/or create their own custom scripts. Again, {{ic|~/.config/openbox/menu.xml}} may and commonly will contain several pipe menus.<br />
<br />
==== Examples ====<br />
<br />
* {{AUR|openbox-xdgmenu}}: fast xdg-menu converter to xml-pipe-menu<br />
* {{AUR|obfilebrowser}}: Application and file browser<br />
* {{AUR|obdevicemenu}}: Management of removable media with [[Udisks]]<br />
* [https://bbs.archlinux.org/viewtopic.php?pid=1345031 wifi pipe menu]: Wireless networking using [[Netctl]]<br />
<br />
[http://openbox.org/download-pipemenus.php Openbox.org] also provides a further list of pipe menus.<br />
<br />
=== Generators ===<br />
<br />
This type of menu is akin to those provided by the taskbars of desktop environments such as [[Xfce]] or [[LXDE]]. Automatically updating on-the-fly, this type of menu can be powerful and very convenient. It may also be possible to add custom categories and menu entries; read the documentation for your intended dynamic menu to determine if and how this can be done.<br />
<br />
A menu generator will have to be executed from the {{ic|~/.config/openbox/menu.xml}} file.<br />
<br />
==== obmenu-generator ====<br />
<br />
{{Tip|icons can still be disabled in {{AUR|obmenu-generator}}, even where enabled in {{ic|~/.config/openbox/rc.xml}}.}}<br />
<br />
{{AUR|obmenu-generator}} is highly recommended despite being an unofficial package. With the ability to be used as a static or dynamic menu, it is highly configurable, powerful, and versatile. Menu categories and individual entries may also be easily hidden, customised, and/or added with ease. The [http://trizenx.blogspot.co.uk/2012/02/obmenu-generator.html official homepage] provides further information and screenshots.<br />
<br />
Below is an example of how obmenu-generator would be dynamically executed without icons in {{ic|~/.config/openbox/menu.xml}}:<br />
<br />
<?xml version="1.0" encoding="utf-8"?><br />
<openbox_menu><br />
<menu id="root-menu" label="OpenBox 3" execute="/usr/bin/obmenu-generator"><br />
</menu><br />
</openbox_menu><br />
<br />
To automatically iconify entries, the {{ic|-i}} option would be added:<br />
<br />
<menu id="root-menu" label="OpenBox 3" execute="/usr/bin/obmenu-generator -i"><br />
<br />
==== openbox-menu ====<br />
<br />
{{Tip|If this menu produces an error, it may be solved by enabling icons in {{ic|~/.config/openbox/rc.xml}}.}}<br />
<br />
{{AUR|openbox-menu}} uses the [[LXDE]] [http://sourceforge.net/projects/lxde/files/menu-cache/ menu-cache] to create dynamic menus. The [http://mimasgpc.free.fr/openbox-menu_en.html official homepage] provides further information and screenshots.<br />
<br />
==== obmenugen ====<br />
<br />
{{AUR|Obmenugen}} can be used to a generate static or dynamic application menu based on {{ic|.desktop}} files. The [http://obmenugen.sourceforge.net/ official homepage] provides further information.<br />
<br />
=== Menu icons ===<br />
<br />
To show icons next to menu entries, it will be necessary to ensure they are enabled in the {{ic|<menu>}} section of the {{ic|~/.config/openbox/rc.xml}} file:<br />
<br />
<applicationIcons>yes</applicationIcons><br />
<br />
Where using a static menu, it will then be necessary to edit the {{ic|~/.config/openbox/menu.xml}} file to provide both the {{ic|icon <nowiki>=</nowiki>}} command, along with the full path and icon name for each entry. An example of the syntax used to provide an icon for a category is:<br />
<br />
<menu id="apps-menu" label="[label name]" icon="[pathway to icon]/[icon name]"><br />
<br />
=== Desktop menu as a panel menu ===<br />
<br />
{{Tip|XDoTool can simulate any keybind for any action, and as such, it may therefore be used for many other purposes...}}<br />
<br />
{{Pkg|xdotool}} is a package that can issue commands to simulate key presses / keybinds, meaning that it is possible to use it to invoke keybind-related actions without having to actually press their assigned keys. As this includes the ability to invoke an assigned keybind for the Openbox desktop menu, it is therefore possible to use XDoTool to turn the Openbox desktop menu into a panel menu. Especially where the desktop menu is heavily customised and feature-rich, this may prove very useful to:<br />
<br />
* Replace an existing panel menu<br />
* Implement a panel menu where otherwise not provided or possible (e.g. for {{AUR|tint2-git}})<br />
* Compensate where losing access to the desktop menu due to the use of an application like [[#xfdesktop|xfdesktop]] to [[#Desktop icons and wallpapers|manage the desktop]].<br />
<br />
Once XDoTool has been installed - if not already present - it will be necessary to create a keybind to access the root menu in {{ic|~/.config/openbox/rc.xml}}, and again below the {{ic|<nowiki><</nowiki>!-- Keybindings for running aplications --<nowiki>></nowiki>}} heading. For example, the following code will bring up the menu by pressing {{ic|CTRL}} + {{ic|m}}:<br />
<br />
<keybind key="C-m"><br />
<action name="ShowMenu"><br />
<menu>root-menu</menu><br />
</action><br />
</keybind><br />
<br />
Openbox must then be [[#Openbox reconfiguration|re-configured]]. In this instance, XDoTool will be used to simulate the {{ic|CTRL}} + {{ic|m}} keypress to access the desktop menu with the following command (note the use of {{ic|+}} in place of {{ic|-}}):<br />
<br />
xdotool key control+m<br />
<br />
How this command may be used as a panel launcher / icon is largely dependent on the features of panel used. While some panels will allow the above command to be executed directly in the process of creating a new launcher, others may require the use of an executable script. As an example, a custom executable script called {{ic|obpanelmenu.sh}} will be created in the {{ic|~/.config}} folder:<br />
<br />
$ ''text editor'' ~/.config/obpanelmenu.sh<br />
<br />
Once the empty file has been opened, the appropriate XDoTool command must be added to the empty file (i.e. to simulate the {{ic|CTRL}} + {{ic|m}} keypress for this example):<br />
<br />
xdotool key control+m<br />
<br />
After the file has been saved and closed, it may then be made into an executable script with the following command:<br />
<br />
$ chmod +x ~/.config/obpanelmenu.sh<br />
<br />
Executing it will bring up the Openbox desktop menu. Consequently, where using a panel that supports drag-and-drop functionality to add new launchers, simply drag the executable script onto it before changing the icon to suit personal taste. For instructions on how to use this executable script with {{AUR|tint2-svn}} - a derivative of the popular {{Pkg|tint2}} panel that allows launchers to be added - see [[Tint2#Application_Launchers_in_tint2-svn_.28AUR.29|Tint2-Svn launchers]].<br />
<br />
== Desktop theming ==<br />
<br />
{{Tip|It is '''strongly advised''' to install the {{Pkg|obconf}} and {{Pkg|lxappearance-obconf}} GUI applications to configure visual settings and theming. The latter is particularly important as it is responsible for generating the {{ic|~/.gtkrc-2.0}} file (see [[GTK+#GTK+ 2.x]]).}}<br />
<br />
It is important to note that a substantial range of both '''Openbox-specific''' and generalised, '''Openbox-compatible''' [[GTK]] themes are available to change the look of window decorations and the desktop menu. ''Generalised'' themes are designed to be simultaneously compatible with a range of popular desktop environments and/or window managers, commonly including Openbox. See these [https://aur.archlinux.org/packages/?O=0&C=0&SeB=n&K=gtk-theme-&outdated=&SB=n&SO=a&PP=50&do_Search=Go package descriptions] for examples. <br />
<br />
=== Configuration ===<br />
<br />
{{Pkg|obconf}} and/or {{Pkg|lxappearance-obconf}} should be used to select and configure available GTK themes. See [[Uniform Look for Qt and GTK Applications]] for information about theming Qt based applications like [[VirtualBox]] or [[Skype]].<br />
<br />
=== Installation: official and AUR ===<br />
<br />
A good selection of {{Pkg|openbox-themes}} are available from the official repositories.<br />
<br />
Both Openbox-specific and Openbox-compatible themes installed from the [[Official_repositories|official repositories]] and/or the [[AUR]] will be automatically installed to the {{ic|/usr/share/themes}} directory. Both will also be immediately available for selection.<br />
<br />
=== Installation: other sources ===<br />
<br />
[http://www.box-look.org/index.php?xcontentmode=7402 box-look.org] is an excellent and well-established source of themes. [http://www.deviantart.com/ deviantART.com] is another excellent resource. Many more can be found through the utilisation of a search engine.<br />
<br />
=== Troubleshooting ===<br />
<br />
There are two particular problems that may be encountered on rare occasions, especially where downloading themes from unsupported websites. These have been addressed below.<br />
<br />
==== Theme cannot be used ====<br />
<br />
If for any reason the newly extracted theme cannot be selected, open the theme directory to first ensure that it is indeed compatible with Openbox by determining that an {{ic|openbox-3}} directory is present, and that within this directory a {{ic|themerc}} file is also present. An {{ic|.obt}} ('''O'''pen'''B'''ox '''T'''heme) file may also be present in some instances, which can then be manually loaded in {{Pkg|obconf}}.<br />
<br />
Where expected files and directories are present and correct, then on occasion it is possible that the theme author has not correctly set permission to access the file (e.g. permission may still be for the account of the author, rather than for '''root'''). To eliminate this possibility, ensure the folder and file permissions are for '''root''':<br />
<br />
# chown -R root /user/share/themes<br />
<br />
==== Theme looks broken ====<br />
<br />
Of course, the first line of enquiry would be to check that it is not just a badly made, broken theme! Otherwise, ensure that the [[Openbox#GTK+ 2|Openbox GTK fix]]{{Dead link|2014|11|28}} has been implemented, and then re-start the session. Unfortunately some older themes can simply break if not maintained sufficiently to keep pace with the changes incurred by [[GTK]] updates. To avoid such occurrences, it is best to check that desired themes have recently been created or at least updated / patched.<br />
<br />
=== Edit or create new themes ===<br />
<br />
{{Tip|Where deciding to modify an existing theme (e.g. the colour scheme), it would be best to work on a copy of it, rather than the original. This will retain the original should anything go wrong, and ensure that your changes are not over-written through an update.}}<br />
<br />
The process of creating new or modifying existing themes is covered extensively at the official [http://openbox.org/wiki/Help:Themes openbox.org] website. {{AUR|obtheme}} is a user-friendly GUI for doing so.<br />
<br />
== Compositing effects ==<br />
<br />
Openbox does not provide native support for [[Wikipedia:Compositing window manager|compositing]], and thus requires an external compositor for this purpose.<br />
<br />
Although compositing is not a necessary component, it may specifically avoid issues such as screen distortion with [[#oblogout|oblogout]], and visual glitches with terminal window transparency. See [[Xorg#Composite]] for common choices.<br />
<br />
== Mouse cursor and application icon themes ==<br />
<br />
See [[Cursor themes]] and [[Icons]] for details.<br />
<br />
== Desktop icons and wallpapers ==<br />
<br />
{{Merge||This section is applicable to most [[window manager]]s when used without [[Desktop environment]]}}<br />
<br />
Openbox does not natively support the use of desktop icons or wallpapers. As a consequence, it will be necessary to install additional applications for this purpose, where desired.<br />
<br />
=== Desktop management using file managers ===<br />
<br />
Some file managers have the capacity to fully '''manage the desktop''', meaning that they may be used to provide wallpapers and enable the use of icons on the desktop. The [[LXDE]] desktop environment itself uses PCManFM for this purpose.<br />
<br />
See [[PCManFM#Desktop_management]] and [[SpaceFM#Desktop_management]].<br />
<br />
=== Wallpaper ===<br />
<br />
See [[List_of_applications#Wallpaper_setters]]<br />
<br />
=== Icon programs ===<br />
<br />
While there are programs dedicated to enabling desktop icons alone, it would seem that they have greater drawbacks than the utilisation of file managers for the task. These programs are discussed briefly, below.<br />
<br />
==== idesk ====<br />
<br />
[[idesk]] is a simple program that can enable icons in addition to managing wallpaper. It will be necessary to create an {{ic|~/.idesktop}} directory, and desktop icons must also be manually created. To use idesk to provide icons, add the following command to the {{ic|~/.config/openbox/autostart}} file:<br />
<br />
idesk &<br />
<br />
==== xfdesktop ====<br />
<br />
{{Pkg|xfdesktop}} is the desktop manager for [[Xfce]]. The [[Thunar]] file manager will also be downloaded as a dependency. Where this is used, the Openbox desktop menu will no longer be accessible by right-clicking the background. <br />
<br />
As such, it will consequently be necessary to access it by other means, such as by [[#Desktop menu|creating a keybind]], and/or by - where permitted - re-configuring an installed panel to use the [[#Desktop menu as a panel menu|desktop menu as a panel menu]]. To use xfdesktop to provide icons, add the following command to the {{ic|~/.config/openbox/autostart}} file:<br />
<br />
xfdesktop &<br />
<br />
=== conky reconfiguration ===<br />
<br />
Particularly where using a file manager to manage the desktop, it will be necessary to edit {{ic|~/.conkyrc}} to change the {{ic|own_window_type}} command in order for [[conky]] to continue to be displayed (where used). The revised command that should be used is:<br />
<br />
own_window_type normal<br />
<br />
== oblogout ==<br />
<br />
See the [[Oblogout]] article for an overview on how to use this useful, graphical logout script.<br />
<br />
== Openbox for multihead users ==<br />
<br />
While Openbox provides better than average multihead support on its own, {{AUR|openbox-multihead-git}} provides a development branch called '''Openbox Multihead''' that gives multihead users per-monitor desktops. This model is not commonly found in floating window managers, but exists mainly in tiling window managers. It is explained well on the [http://xmonad.org/tour.html#workspace Xmonad web site]. Also, please see [https://github.com/BurntSushi/openbox-multihead/blob/multihead/README.MULTIHEAD README.MULTIHEAD] for a more comprehensive description of the new features and configuration options found in Openbox Multihead.<br />
<br />
Openbox Multihead will function like normal Openbox when only a single head is available.<br />
<br />
A downside to using Openbox Multihead is that it breaks the EWMH assumption that one and only one desktop is visible at any time. Thus, existing pagers will not work well with it. To remedy this, you can install {{AUR|pager-multihead-git}} alongside Openbox Multihead. <br />
<br />
Finally, {{AUR|pytyle3-git}} is a new version of [[PyTyle]] that will work with Openbox Multihead.<br />
<br />
Both ''pytyle3'' and ''pager-multihead-git'' will work without Openbox Multihead if only one monitor is active.<br />
<br />
== Tips and tricks ==<br />
<br />
=== Launch a complex command with hotkey ===<br />
<br />
If you need to execute a complex command, use shell functionality.<br />
<br />
Special character replacement are as follows:<br />
<br />
* {{ic|&}}: &amp;amp;<br />
* {{ic|<}}: &amp;lt;<br />
* {{ic|>}}: &amp;gt;<br />
<br />
This example will turn off display immediately and lock screen with {{Pkg|slock}}. It was taken from [https://bbs.archlinux.org/viewtopic.php?pid=903057 this thread].<br />
<keybind key="W-l"><br />
<action name="Execute"><br />
<command>sh -c 'slock &amp;amp; (sleep .5 &amp;amp;&amp;amp; xset dpms force off)'</command><br />
</action><br />
</keybind><br />
<br />
Sometimes one need to specify environment variable for application:<br />
<keybind key="A-F7"><br />
<action name="Execute"><br />
<command>sh -c "LC_ALL=C obconf"</command><br />
</action><br />
</keybind><br />
<br />
Another example will launch application preserving all stdout and stderr output to file:<br />
<keybind key="A-f"><br />
<action name="Execute"><br />
<command>sh -c sh -c "exec gimp &amp;gt;/tmp/gimp.out 2&amp;gt;&amp;amp;1"</command><br />
</action><br />
</keybind><br />
<br />
=== Switch desktops using the mouse ===<br />
<br />
It is possible to switch desktop by moving the mouse cursor to the edges of the screen. First install {{Pkg|xdotool}} and add the following two lines to your {{ic|~/.xinitrc}}:<br />
<br />
xdotool behave_screen_edge --delay 500 left set_desktop --relative -- -1 &<br />
xdotool behave_screen_edge --delay 500 right set_desktop --relative -- +1 &<br />
<br />
=== Set default applications / file associations ===<br />
<br />
See the [[Default applications]] article.<br />
<br />
=== Stop continous mouse wheel desktop switching ===<br />
<br />
By default Openbox switches from the last desktop back to the first desktop on mouse wheel scroll. Use {{ic|<wrap>no</wrap>}} in the {{ic|mousebind}} section to disable this behaviour.<br />
<br />
<context name="Desktop"><br />
<mousebind button="Up" action="Click"><br />
<action name="GoToDesktop"><br />
<to>previous</to><br />
<wrap>no</wrap><br />
</action><br />
</mousebind><br />
<mousebind button="Down" action="Click"><br />
<action name="GoToDesktop"><br />
<to>next</to><br />
<wrap>no</wrap><br />
</action><br />
</mousebind><br />
</context><br />
<br />
=== Ad-hoc window transparency ===<br />
<br />
{{Warning|This may not work where other actions are defined within the action group.}}<br />
The program {{Pkg|transset-df}} is available in the official repositories, and can enable window transparency on-the-fly.<br />
<br />
For example, using the following code in the {{ic|<mouse>}} section of the {{ic|~/.config/openbox/rc.xml}} file will enable control of application window transparency by hovering the mouse-pointer over the title bar and scrolling with the middle button:<br />
<br />
<context name="Titlebar"><br />
...<br />
<mousebind button="Up" action="Click"><br />
<action name= "Execute" ><br />
<execute>transset-df -p .2 --inc </execute><br />
</action><br />
</mousebind><br />
<mousebind button="Down" action="Click"><br />
<action name= "Execute" ><br />
<execute>transset-df -p .2 --dec </execute><br />
</action><br />
</mousebind><br />
...<br />
</context><br />
<br />
=== Using obxprop for faster configuration ===<br />
<br />
The {{Pkg|openbox}} package provides a {{ic|obxprop}} binary that can parse relevant values for applications settings in {{ic|rc.xml}}. Officially {{ic|<nowiki>obxprop | grep "^_OB_APP"</nowiki>}} is recommended for this task. Start the process by running the command shown, then click a window to see its properties in the terminal.<br />
<br />
=== Xprop values for applications ===<br />
<br />
{{Pkg|xorg-xprop}} is available in the official repositories, and can be used to relay property values for selected applications. Where frequently using per-application settings, the following [[Bash#Aliases|Bash Alias]] may be useful:<br />
dy:<br />
<br />
alias xp='xprop | grep "WM_WINDOW_ROLE\|WM_CLASS" && echo "WM_CLASS(STRING) = \"NAME\", \"CLASS\""'<br />
<br />
To use Xorg-XProp, run using the alias given {{ic|xp}}, and click on the active program desired to define with per-application settins. The results displayed will only be the information that Openbox itself requires, namely the {{ic|WM_WINDOW_ROLE}} and {{ic|WM_CLASS}} (name and class) values:<br />
<br />
WM_WINDOW_ROLE(STRING) = "roster"<br />
WM_CLASS(STRING) = "gajim.py", "Gajim.py"<br />
WM_CLASS(STRING) = "NAME", "CLASS"<br />
<br />
==== Firefox ====<br />
<br />
For whatever reason, Firefox and like-minded equivalents ignore application rules (e.g. ''<desktop>'') unless {{ic|class&#61;"Firefox*"}} is used. This applies irrespective of whatever values '''xprop''' may report for the program's {{ic|WM_CLASS}}.<br />
<br />
=== Switching between keyboard layouts ===<br />
<br />
See the article section [[Keyboard configuration in Xorg#Switching between keyboard layouts|switching between keyboard layouts]] for instructions.<br />
<br />
=== Set grid layout for virtual desktops ===<br />
<br />
Install {{AUR|obsetlayout}}. To set a 2x2 grid for example:<br />
<br />
obsetlayout 0 2 2 0<br />
<br />
Run it without arguments to know what the arguments mean.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Windows load behind the active window ===<br />
<br />
Some application windows (such as Firefox windows) may load behind the currently active window, causing you to need to switch to the window you just created to focus it. To fix this behavior add this to your {{ic|~/.config/openbox/rc.xml}} file, inbetween the {{ic|1=<openbox_config>}} and {{ic|1=</openbox_config>}} tags:<br />
<br />
{{bc|1=<br />
<applications><br />
<application class="*"><br />
<focus>yes</focus><br />
</application><br />
</applications><br />
}}<br />
<br />
== See also ==<br />
<br />
* [http://openbox.org/ Openbox Website] - Official website<br />
* [http://www.box-look.org/ Box-Look.org] - A good resource for themes and related artwork<br />
* [https://bbs.archlinux.org/viewtopic.php?id=93126 Openbox Hacks and Configs Thread] @ Arch Linux Forums<br />
* [https://bbs.archlinux.org/viewtopic.php?id=45692 Openbox Screenshots Thread] @ Arch Linux Forums<br />
* [http://urukrama.wordpress.com/openbox-guide/ An Openbox guide]</div>Akleophttps://wiki.archlinux.org/index.php?title=Openbox&diff=433171Openbox2016-04-29T16:45:01Z<p>Akleop: /* Configuration */</p>
<hr />
<div>[[Category:Stacking WMs]]<br />
[[cs:Openbox]]<br />
[[de:Openbox]]<br />
[[el:Openbox]]<br />
[[es:Openbox]]<br />
[[fr:Openbox]]<br />
[[it:Openbox]]<br />
[[ja:Openbox]]<br />
[[ko:Openbox]]<br />
[[lt:Openbox]]<br />
[[nl:Openbox]]<br />
[[pl:Openbox]]<br />
[[ru:Openbox]]<br />
[[sk:Openbox]]<br />
[[sr:Openbox]]<br />
[[tr:Openbox]]<br />
[[zh-CN:Openbox]]<br />
[[zh-TW:Openbox]]<br />
{{Related articles start}}<br />
{{Related|Desktop environment}}<br />
{{Related|Display manager}}<br />
{{Related|File manager functionality}}<br />
{{Related|Window manager}}<br />
{{Related|Oblogout}}<br />
{{Related|Xdg-menu}}<br />
{{Related articles end}}<br />
<br />
Openbox is a lightweight, powerful, and highly configurable ''stacking'' [[window manager]] with extensive standards support. It may be built upon and run independently as the basis of a unique [[desktop environment]], or within other integrated desktop environments such as [[KDE]] and [[Xfce]], as an alternative to the window managers they provide. The [[LXDE]] desktop environment is itself built around Openbox.<br />
<br />
A comprehensive list of features are documented at the [http://openbox.org/ official Openbox website]. This article pertains to specifically installing Openbox under Arch Linux.<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|openbox}} package.<br />
<br />
=== Standalone ===<br />
<br />
[[Display manager]]s will automatically detect Openbox, allowing for it to be run as a standalone session.<br />
<br />
To start openbox with [[Xinitrc]], add the following line:<br />
<br />
exec openbox-session<br />
<br />
{{Note|Specifying {{ic|openbox}} instead of {{ic|openbox-session}} will prevent [[#autostart|autostart]] in {{ic|/etc/xdg/autostart}}.}}<br />
<br />
=== Other desktop environments ===<br />
<br />
{{Note|<br />
* When replacing the native window manager of a [[desktop environment]] with Openbox, keep in mind that Openbox does not provide any compositing effects (such as transparency). See [[#Compositing effects]].<br />
* Openbox does work with GNOME applications (but see [[GTK+#Client-side decorations]]). [http://comments.gmane.org/gmane.comp.window-managers.openbox/6595]}}<br />
<br />
See [[Desktop environment#Custom window manager]].<br />
<br />
== Configuration==<br />
<br />
{{Note|Local configuration files will always override global equivalents.}}<br />
<br />
Four key files form the basis of the openbox configuration, each serving a unique role. They are: {{ic|rc.xml}}, {{ic|menu.xml}}, {{ic|autostart}}, and {{ic|environment}}. Although these files are discussed in more detail below, to start configuring Openbox, it will first be necessary to create a '''local''' Openbox profile (i.e for your specific user account) based on them. This can be done by copying them from the '''global''' {{ic|/etc/xdg/openbox}} profile (applicable to any and all users) as a template:<br />
<br />
$ cp -R /etc/xdg/openbox ~/.config/openbox/<br />
<br />
=== rc.xml ===<br />
<br />
{{Tip|Custom keyboard shortcuts (keybindings) must be added to the {{ic|<keyboard>}} section of this file, and underneath the {{ic|<nowiki><!-- Keybindings for running aplications --></nowiki>}} heading.}}<br />
<br />
{{ic|~/.config/openbox/rc.xml}} is the main configuration file, responsible for determining the behaviour and settings of the overall session, including:<br />
<br />
* Keyboard shortcuts (e.g. starting applications; controlling the volume)<br />
* Theming<br />
* Desktop and Virtual desktop settings, and<br />
* Application Window settings<br />
<br />
This file is also pre-configured, meaning that it will only be necessary to amend existing content in order to customise behaviour to suit personal preference.<br />
<br />
{{Note|Per-application settings pertaining to fixed placement of applications per monitor will only work if the x & y position have also been defined.}}<br />
<br />
=== menu.xml ===<br />
<br />
{{ic|~/.config/openbox/menu.xml}} defines the type and behaviour of the desktop menu, accessable by right-clicking the background. Although the default provided is a '''static menu''' (meaning that it will not automatically update when new applications are installed), it is possible to employ the use of '''dynamic menus''' that will automatically update as well. <br />
<br />
The available options are discussed extensively below in the [[#Menus|Menus]] section.<br />
<br />
=== autostart ===<br />
<br />
The file {{ic|~/.config/openbox/autostart}}, if present, is executed by Openbox at startup. A basic example of this file consists of one command per line, like so:<br />
<br />
xset -b<br />
nm-applet &<br />
conky &<br />
<br />
Note that a single ampersand ({{ic|&}}) causes the process in question to be run in the background, allowing the script to continue on to the next command. An ampersand is therefore needed after each command that launches a process of indefinite duration. Commands that are completed essentially instantly (e.g. {{ic|xset -b}}) may be left alone.<br />
<br />
Issues regarding commands in {{ic|~/.config/openbox/autostart}} being executed out of order (or skipped altogether) are often resolved by the addition of small delays. For instance:<br />
<br />
xset -b<br />
(sleep 3s && nm-applet) &<br />
(sleep 3s && conky) &<br />
<br />
{{Note|In addition to running {{ic|~/.config/openbox/autostart}}, Openbox will also launch programs with {{ic|.desktop}} files present in {{ic|/etc/xdg/autostart}}. This is the global [[autostart]] directory, which is automatically sourced by XDG-compliant desktop environments (e.g. GNOME, KDE). Openbox will source this directory as well, provided that the package {{Pkg|python2-xdg}} is installed, and Openbox is launched as {{ic|openbox-session}} (rather than simply {{ic|openbox}}, as [[#Standalone|noted earlier]]). Duplication between {{ic|~/.config/openbox/autostart}} and {{ic|/etc/xdg/autostart}} is a common cause of programs launching twice at startup (e.g. two network manager tray icons).}}<br />
<br />
The {{ic|/usr/lib/openbox/openbox-xdg-autostart}} python2 script runs applications based on the XDG autostart specification.<br />
<br />
=== environment ===<br />
<br />
{{ic|~/.config/openbox/environment}} can be used to export and set relevant environmental variables such as to:<br />
<br />
* Define new pathways (e.g. execute commands that would otherwise require the entire pathway to be listed with them)<br />
* Change language settings, and<br />
* Define other variables to be used (e.g. the fix for GTK theming could be listed here)<br />
<br />
=== GUI configuration ===<br />
<br />
Several GUI applications are available to quickly and easily configure your Openbox desktop. From the [[official repositories]]:<br />
<br />
* {{App|ObConf|A GTK2 based configuration tool for the Openbox window manager.|http://openbox.org/wiki/ObConf:About|{{Pkg|obconf}}}}<br />
* {{App|LXAppearance ObConf|Plugin for LXAppearance to configure Openbox. Note that not all options to configure Openbox are available in this plugin, so you might want to install obconf anyway.|http://lxde.org|{{Pkg|lxappearance-obconf}}}}<br />
* {{App|LXInput|LXDE keyboard and mouse configuration|http://lxde.org|{{Pkg|lxinput}}}}<br />
* {{App|LXRandR|LXDE monitor configuration.|http://wiki.lxde.org/en/LXRandR|{{Pkg|lxrandr}}}}<br />
* {{App|obkey|Configure Openbox keyboard shortcuts|https://code.google.com/p/obkey/|{{AUR|obkey}}}} <br />
* {{App|ob-autostart|A simple autostart application for Openbox.|http://pastebin.com/012YgXTk|{{AUR|ob-autostart}}}} <br />
<br />
Programs and applications relating to the configuration of Openbox's desktop menu are discussed in the [[#Menus|Menus]] section.<br />
<br />
== Openbox reconfiguration ==<br />
<br />
{{Tip|where not already present, it would be worthwhile adding this command to a menu and/or as a keybind for convenience.}}<br />
<br />
Openbox will not always automatically reflect any changes made to its configuration files within a session. As a consequence, it will be necessary to manually reload those files after they have been edited. To do so, enter the following command:<br />
<br />
$ openbox --reconfigure<br />
<br />
Where intending to add this command as a keybind to {{ic|~/.config/openbox/rc.xml}}, it will only be necessary to list the command as {{ic|reconfigure}}. An example has been provided below, using the {{ic|Super}}+{{ic|F11}} keybind:<br />
<br />
<keybind key="W-F11"><br />
<action name="Reconfigure"/><br />
</keybind><br />
<br />
== Keybinds ==<br />
<br />
All keybinds must be added to the {{ic|~/.config/openbox/rc.xml}} file, and below the {{ic|<nowiki><!-- Keybindings for running aplications --></nowiki>}} heading. Although a brief overview has been provided here, a more in-depth explanation of keybindings can be found at [http://openbox.org/wiki/Help:Bindings openbox.org]. {{AUR|obkey}} is a utility for adjust key-binding. Before using obkey, you should use obconf to create {{ic|~/.config/openbox/rc.xml}}.<br />
<br />
=== Special keys ===<br />
<br />
While the use of standard alpha-numeric keys for keybindings is self-explanatory, special names are assigned to other types of keys, such as {{ic|modifers}}, {{ic|multimedia}} keys and {{ic|navigation}} keys.<br />
<br />
==== Modifiers ====<br />
<br />
{{ic|Modifer}} keys play an important role in keybindings (e.g. holding down the {{ic|shift}} or {{ic|CTRL / control}} key in combination with another key to undertake an action). Using modifers helps to prevent conflicting keybinds, whereby two or more actions are linked to the same key or combination of keys. The syntax to use a modifer with another key is:<br />
<br />
"<modifier>-<key>"<br />
<br />
The modifer codes are as follows:<br />
<br />
* {{ic|S}}: Shift<br />
* {{ic|C}}: Control / CTRL<br />
* {{ic|A}}: Alt<br />
* {{ic|W}}: Super / Windows<br />
* {{ic|M}}: Meta<br />
* {{ic|H}}: Hyper (If it is bound to something) <br />
<br />
For example, the code below would use {{ic|super}} and {{ic|t}} to launch {{Pkg|lxterminal}}<br />
<br />
<keybind key="W-t"><br />
<action name="Execute"><br />
<command>lxterminal</command><br />
</action><br />
</keybind><br />
<br />
==== Multimedia keys ====<br />
<br />
{{Merge|Extra keyboard keys in Xorg}}<br />
<br />
Where available, it is possible to set the appropriate {{ic|multimedia}} keys to perform their intended functions, such as to control the volume and/or the screen brightness. These will usually be integrated into the {{ic|function}} keys, and are identified by their appropriate symbols. See [[Extra keyboard keys]] for details.<br />
<br />
The volume and brightness multimedia codes are as follows (note that commands will still have to be assigned to them to actually function):<br />
<br />
* {{ic|XF86AudioRaiseVolume}}: Increase volume<br />
* {{ic|XF86AudioLowerVolume}}: Decrease volume<br />
* {{ic|XF86AudioMute}}: Mute / unmute volume<br />
* {{ic|XF86MonBrightnessUp}}: Increase screen brightess<br />
* {{ic|XF86MonBrightnessDown}}: Decrease screen brightness<br />
<br />
Examples of how these may be used in {{ic|~/.config/openbox/rc.xml}} have been provided below.<br />
<br />
==== Navigation keys ====<br />
<br />
These are the directional / arrow keys, usually used to move the cursor up, down, left, or right. The (self-explanatory) navigation codes are as follows:<br />
<br />
* {{ic|Up}}: Up<br />
* {{ic|Down}}: Down<br />
* {{ic|Left}}: Left<br />
* {{ic|Right}}: Right<br />
<br />
=== Volume Control ===<br />
<br />
What commands should be used for controlling the volume will depend on whether [[ALSA]], [[PulseAudio]], or [[OSS]] is used for sound.<br />
<br />
==== ALSA ====<br />
<br />
If [[ALSA]] is used for sound, the {{ic|amixer}} program can be used to adjust the volume, which is part of the {{Pkg|alsa-utils}} package. The following example - using the {{ic|multimedia}} keys intended to control the volume - will adjust the volume by +/- 5% (which may be changed, as desired):<br />
<br />
<keybind key="XF86AudioRaiseVolume"><br />
<action name="Execute"><br />
<command>amixer set Master 5%+ unmute</command><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioLowerVolume"><br />
<action name="Execute"><br />
<command>amixer set Master 5%- unmute</command><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioMute"><br />
<action name="Execute"><br />
<command>amixer set Master toggle</command><br />
</action><br />
</keybind><br />
<br />
==== Pulseaudio ====<br />
<br />
Where using [[PulseAudio]] with [[ALSA]] as a backend, the {{ic|amixer}} program commands will have to be modifed, as illustrated below in comparison to the ALSA example:<br />
<br />
<keybind key="XF86AudioRaiseVolume"><br />
<action name="Execute"><br />
<command>amixer -D pulse set Master 5%+ unmute</command><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioLowerVolume"><br />
<action name="Execute"><br />
<command>amixer -D pulse set Master 5%- unmute</command><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioMute"><br />
<action name="Execute"><br />
<command>amixer -D pulse set Master toggle</command><br />
</action><br />
</keybind><br />
<br />
==== OSS ====<br />
<br />
{{Note|This option may be suitable for more experienced users.}}<br />
<br />
Where using [[OSS]], it is possible to create keybindings to raise or lower specific mixers. This allows, for example, the volume of a specific application (such as an audio player) to be changed without changing the overall system volume settings in turn. In this instance, the application must first have been [[OSS#Configuring_Applications_for_OSS|configured]] to use its own mixer. <br />
<br />
In the following example, [[MPD]] has been configured to use its own mixer - also named {{ic|mpd}} - to increase and decrease the volume by a single decibel at a time. The {{ic|--}} that appears after the {{ic|ossmix}} command has been added to prevent a negative value from being treated as an argument: <br />
<br />
<keybind key="[chosen keybind]"><br />
<action name="Execute"><br />
<command>ossmix -- mpd +1</command><br />
</action><br />
</keybind><br />
<keybind key="[chosen keybind]"><br />
<action name="Execute"><br />
<command>ossmix -- mpd -1</command><br />
</action><br />
</keybind><br />
<br />
=== Media player control ===<br />
<br />
The {{AUR|playerctl}} command-line utility can be used to bind multimedia keys to player actions. It should work with most media players.<br />
<br />
<keybind key="XF86AudioPlay"><br />
<action name="Execute"><br />
<command>playerctl play</command><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioPause"><br />
<action name="Execute"><br />
<command>playerctl pause</command><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioNext"><br />
<action name="Execute"><br />
<command>playerctl next</command><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioPrev"><br />
<action name="Execute"><br />
<command>playerctl previous</command><br />
</action><br />
</keybind><br />
<br />
=== Brightness control ===<br />
<br />
The {{ic|xbacklight}} program is used to control screen brightness, which is part of the [[Xorg]] X-Window system. In the example below, the {{ic|multimedia}} keys intended to control the screen brightness will adjust the settings by +/- 10%:<br />
<br />
<keybind key="XF86MonBrightnessUp"><br />
<action name="Execute"><br />
<command>xbacklight +10</command><br />
</action><br />
</keybind><br />
<keybind key="XF86MonBrightnessDown"><br />
<action name="Execute"><br />
<command>xbacklight -10</command><br />
</action><br />
</keybind><br />
<br />
=== Window snapping ===<br />
<br />
Many desktop environments and window managers support ''window snapping'' (e.g. Windows 7 Aero snap), whereby they will automatically snap into place when moved to the edge of the screen. This effect can also be simulated in Openbox through the use of keybinds on focused windows. <br />
<br />
As illustrated in the example below, percentages must be used to determine window sizes (see [http://openbox.org/wiki/Help:Actions openbox.org] for further information). In this instance, The {{ic|super}} key is used in conjunction with the {{ic|navigation}} keys:<br />
<br />
<keybind key="W-Left"><br />
<action name="UnmaximizeFull"/><br />
<action name="MaximizeVert"/><br />
<action name="MoveResizeTo"><br />
<width>50%</width><br />
</action><br />
<action name="MoveToEdge"><direction>west</direction></action><br />
</keybind><br />
<keybind key="W-Right"><br />
<action name="UnmaximizeFull"/><br />
<action name="MaximizeVert"/><br />
<action name="MoveResizeTo"><br />
<width>50%</width><br />
</action><br />
<action name="MoveToEdge"><direction>east</direction></action><br />
</keybind><br />
<br />
However, it should be noted that once a window has been 'snapped' to an edge, it will remain vertically maximised unless subsequently maximised and then restored. The solution is to implement additional keybinds - in this instance using the {{ic|down}} and {{ic|up}} keys - to do so. This will also make pulling 'snapped' windows from screen edges faster as well:<br />
<br />
<keybind key="W-Down"><br />
<action name="Unmaximize"/><br />
</keybind><br />
<keybind key="W-Up"><br />
<action name="Maximize"/><br />
</keybind><br />
<br />
This [http://ubuntuforums.org/showthread.php?t=1796793 Ubuntu forum thread] provides more information. Applications such as {{AUR|opensnap-git}} are also available to automatically simulate window snapping behaviour without the use of keybinds.<br />
<br />
=== Desktop menu ===<br />
<br />
It is also possible to create a keybind to access the desktop menu. For example, the following code will bring up the menu by pressing {{ic|CTRL}} + {{ic|m}}:<br />
<br />
<keybind key="C-m"><br />
<action name="ShowMenu"><br />
<menu>root-menu</menu><br />
</action><br />
</keybind><br />
<br />
== Menus ==<br />
<br />
It is possible to employ three types of menu in Openbox: {{ic|static}}, {{ic|pipes}} (dynamic), and {{ic|generators}} (static or dynamic). They may also be used alone or in any combination.<br />
<br />
=== Static ===<br />
<br />
As the name would suggest, this default type of menu does not change in any way, and may be manually edited and/or (re)generated automatically through the use on an appropriate software package.<br />
<br />
Fast and efficient, while this type of menu can be used to select applications, it can also be useful to access specific functions and/or perform specific tasks (e.g. desktop configuration), leaving the access of applications to another process (e.g. the {{Pkg|synapse}} or {{Pkg|xfce4-appfinder}} applications).<br />
<br />
The {{ic|~/.config/openbox/menu.xml}} file will be the sole source of static desktop menu content.<br />
<br />
==== menumaker ====<br />
<br />
{{Warning|A root terminal '''must''' be installed in order to use MenuMaker, even though a standard user terminal may be used to run it. {{Pkg|xterm}} is a good choice.}}<br />
<br />
{{Pkg|menumaker}} automatically generates {{ic|xml}} menus for several window managers, including Openbox, [[Fluxbox]], [[IceWM]] and [[Xfce]]. It will search for all installed executable programs and consequently create a menu file for them. It is also possible to configure MenuMaker to exclude certain application types (e.g. relating to [[GNOME]] or [[KDE]]), if desired.<br />
<br />
Once installed and executed, it will automatically generate a new {{ic|~/.config/openbox/menu.xml}} file. To avoid overwriting an existing file, enter:<br />
<br />
$ mmaker -v OpenBox3<br />
<br />
Otherwise, to overwrite an existing file, add the {{ic|force}} argument ({{ic|f}}):<br />
<br />
$ mmaker -vf OpenBox3<br />
<br />
Once a new {{ic|~/.config/openbox/menu.xml}} file has been generated it may then be manually edited, or configured using a GUI menu editor, such as {{Pkg|obmenu}}.<br />
<br />
==== obmenu ====<br />
<br />
{{Warning|{{ic|obm-xdg}} - a pipe menu to generate a list of [[GTK+]] and [[GNOME]] applications - is also provided with obmenu. However, it has long-running bugs whereby it may produce an invalid output, or even not function at all. Consequently it has been omitted from discussion.}}<br />
<br />
{{Pkg|obmenu}} is a "user-friendly" GUI application to edit {{ic|~/.config/openbox/menu.xml}}, without the need to code in {{ic|xml}}.<br />
<br />
==== xdg-menu ====<br />
<br />
{{Pkg|archlinux-xdg-menu}} will automatically generate a menu based on {{ic|xdg}} files contained within the {{ic|/etc/xdg/}} directory for numerous Window Managers, including Openbox. Review the [[Xdg-menu#OpenBox]] article for further information.<br />
<br />
==== logout menu options ====<br />
<br />
{{Tip|The commands provided can also be attached to [[#Keybinds|keybinds]].}}<br />
<br />
The {{ic|~/.config/openbox/menu.xml}} file can be edited in order to provide a sub-menu with the same options as provided by [[#oblogout|oblogout]]. The sample script below will provide all of these options, with the exception of the ability to lock the screen:<br />
<br />
<menu id="exit-menu" label="Exit"><br />
<item label="Log Out"><br />
<action name="Execute"><br />
<command>openbox --exit</command><br />
</action><br />
</item><br />
<item label="Shutdown"><br />
<action name="Execute"><br />
<command>systemctl poweroff</command><br />
</action><br />
</item><br />
<item label="Restart"><br />
<action name="Execute"><br />
<command>systemctl reboot</command><br />
</action><br />
</item><br />
<item label="Suspend"><br />
<action name="Execute"><br />
<command>systemctl suspend</command><br />
</action><br />
</item><br />
<item label="Hibernate"><br />
<action name="Execute"><br />
<command>systemctl hibernate</command><br />
</action><br />
</item><br />
</menu><br />
<br />
Once the entries have been composed, add the following line to present the sub-menu where desired within the main desktop menu (usually as the last entry):<br />
<br />
<menu id="exit-menu"/><br />
<br />
=== Pipes ===<br />
<br />
{{Tip|It is entirely feasible for a static menu to contain one or more pipe sub-menus. The functionality of some pipe menus may also rely on the installation of relevant software packages.}}<br />
<br />
This type of menu is in essence a script that provides dynamic, refreshed lists on-the-fly as and when run. These lists may be used for multiple purposes, including to list applications, to provide information, and to provide control functions. Pre-configured pipe menus can be installed, although not from the [[official repositories]]. More experienced users can also modify and/or create their own custom scripts. Again, {{ic|~/.config/openbox/menu.xml}} may and commonly will contain several pipe menus.<br />
<br />
==== Examples ====<br />
<br />
* {{AUR|openbox-xdgmenu}}: fast xdg-menu converter to xml-pipe-menu<br />
* {{AUR|obfilebrowser}}: Application and file browser<br />
* {{AUR|obdevicemenu}}: Management of removable media with [[Udisks]]<br />
* [https://bbs.archlinux.org/viewtopic.php?pid=1345031 wifi pipe menu]: Wireless networking using [[Netctl]]<br />
<br />
[http://openbox.org/download-pipemenus.php Openbox.org] also provides a further list of pipe menus.<br />
<br />
=== Generators ===<br />
<br />
This type of menu is akin to those provided by the taskbars of desktop environments such as [[Xfce]] or [[LXDE]]. Automatically updating on-the-fly, this type of menu can be powerful and very convenient. It may also be possible to add custom categories and menu entries; read the documentation for your intended dynamic menu to determine if and how this can be done.<br />
<br />
A menu generator will have to be executed from the {{ic|~/.config/openbox/menu.xml}} file.<br />
<br />
==== obmenu-generator ====<br />
<br />
{{Tip|icons can still be disabled in {{AUR|obmenu-generator}}, even where enabled in {{ic|~/.config/openbox/rc.xml}}.}}<br />
<br />
{{AUR|obmenu-generator}} is highly recommended despite being an unofficial package. With the ability to be used as a static or dynamic menu, it is highly configurable, powerful, and versatile. Menu categories and individual entries may also be easily hidden, customised, and/or added with ease. The [http://trizenx.blogspot.co.uk/2012/02/obmenu-generator.html official homepage] provides further information and screenshots.<br />
<br />
Below is an example of how obmenu-generator would be dynamically executed without icons in {{ic|~/.config/openbox/menu.xml}}:<br />
<br />
<?xml version="1.0" encoding="utf-8"?><br />
<openbox_menu><br />
<menu id="root-menu" label="OpenBox 3" execute="/usr/bin/obmenu-generator"><br />
</menu><br />
</openbox_menu><br />
<br />
To automatically iconify entries, the {{ic|-i}} option would be added:<br />
<br />
<menu id="root-menu" label="OpenBox 3" execute="/usr/bin/obmenu-generator -i"><br />
<br />
==== openbox-menu ====<br />
<br />
{{Tip|If this menu produces an error, it may be solved by enabling icons in {{ic|~/.config/openbox/rc.xml}}.}}<br />
<br />
{{AUR|openbox-menu}} uses the [[LXDE]] [http://sourceforge.net/projects/lxde/files/menu-cache/ menu-cache] to create dynamic menus. The [http://mimasgpc.free.fr/openbox-menu_en.html official homepage] provides further information and screenshots.<br />
<br />
==== obmenugen ====<br />
<br />
{{AUR|Obmenugen}} can be used to a generate static or dynamic application menu based on {{ic|.desktop}} files. The [http://obmenugen.sourceforge.net/ official homepage] provides further information.<br />
<br />
=== Menu icons ===<br />
<br />
To show icons next to menu entries, it will be necessary to ensure they are enabled in the {{ic|<menu>}} section of the {{ic|~/.config/openbox/rc.xml}} file:<br />
<br />
<applicationIcons>yes</applicationIcons><br />
<br />
Where using a static menu, it will then be necessary to edit the {{ic|~/.config/openbox/menu.xml}} file to provide both the {{ic|icon <nowiki>=</nowiki>}} command, along with the full path and icon name for each entry. An example of the syntax used to provide an icon for a category is:<br />
<br />
<menu id="apps-menu" label="[label name]" icon="[pathway to icon]/[icon name]"><br />
<br />
=== Desktop menu as a panel menu ===<br />
<br />
{{Tip|XDoTool can simulate any keybind for any action, and as such, it may therefore be used for many other purposes...}}<br />
<br />
{{Pkg|xdotool}} is a package that can issue commands to simulate key presses / keybinds, meaning that it is possible to use it to invoke keybind-related actions without having to actually press their assigned keys. As this includes the ability to invoke an assigned keybind for the Openbox desktop menu, it is therefore possible to use XDoTool to turn the Openbox desktop menu into a panel menu. Especially where the desktop menu is heavily customised and feature-rich, this may prove very useful to:<br />
<br />
* Replace an existing panel menu<br />
* Implement a panel menu where otherwise not provided or possible (e.g. for {{AUR|tint2-git}})<br />
* Compensate where losing access to the desktop menu due to the use of an application like [[#xfdesktop|xfdesktop]] to [[#Desktop icons and wallpapers|manage the desktop]].<br />
<br />
Once XDoTool has been installed - if not already present - it will be necessary to create a keybind to access the root menu in {{ic|~/.config/openbox/rc.xml}}, and again below the {{ic|<nowiki><</nowiki>!-- Keybindings for running aplications --<nowiki>></nowiki>}} heading. For example, the following code will bring up the menu by pressing {{ic|CTRL}} + {{ic|m}}:<br />
<br />
<keybind key="C-m"><br />
<action name="ShowMenu"><br />
<menu>root-menu</menu><br />
</action><br />
</keybind><br />
<br />
Openbox must then be [[#Openbox reconfiguration|re-configured]]. In this instance, XDoTool will be used to simulate the {{ic|CTRL}} + {{ic|m}} keypress to access the desktop menu with the following command (note the use of {{ic|+}} in place of {{ic|-}}):<br />
<br />
xdotool key control+m<br />
<br />
How this command may be used as a panel launcher / icon is largely dependent on the features of panel used. While some panels will allow the above command to be executed directly in the process of creating a new launcher, others may require the use of an executable script. As an example, a custom executable script called {{ic|obpanelmenu.sh}} will be created in the {{ic|~/.config}} folder:<br />
<br />
$ ''text editor'' ~/.config/obpanelmenu.sh<br />
<br />
Once the empty file has been opened, the appropriate XDoTool command must be added to the empty file (i.e. to simulate the {{ic|CTRL}} + {{ic|m}} keypress for this example):<br />
<br />
xdotool key control+m<br />
<br />
After the file has been saved and closed, it may then be made into an executable script with the following command:<br />
<br />
$ chmod +x ~/.config/obpanelmenu.sh<br />
<br />
Executing it will bring up the Openbox desktop menu. Consequently, where using a panel that supports drag-and-drop functionality to add new launchers, simply drag the executable script onto it before changing the icon to suit personal taste. For instructions on how to use this executable script with {{AUR|tint2-svn}} - a derivative of the popular {{Pkg|tint2}} panel that allows launchers to be added - see [[Tint2#Application_Launchers_in_tint2-svn_.28AUR.29|Tint2-Svn launchers]].<br />
<br />
== Desktop theming ==<br />
<br />
{{Tip|It is '''strongly advised''' to install the {{Pkg|obconf}} and {{Pkg|lxappearance-obconf}} GUI applications to configure visual settings and theming. The latter is particularly important as it is responsible for generating the {{ic|~/.gtkrc-2.0}} file (see [[GTK+#GTK+ 2.x]]).}}<br />
<br />
It is important to note that a substantial range of both '''Openbox-specific''' and generalised, '''Openbox-compatible''' [[GTK]] themes are available to change the look of window decorations and the desktop menu. ''Generalised'' themes are designed to be simultaneously compatible with a range of popular desktop environments and/or window managers, commonly including Openbox. See these [https://aur.archlinux.org/packages/?O=0&C=0&SeB=n&K=gtk-theme-&outdated=&SB=n&SO=a&PP=50&do_Search=Go package descriptions] for examples. <br />
<br />
=== Configuration ===<br />
<br />
{{Pkg|obconf}} and/or {{Pkg|lxappearance-obconf}} should be used to select and configure available GTK themes. See [[Uniform Look for Qt and GTK Applications]] for information about theming Qt based applications like [[VirtualBox]] or [[Skype]].<br />
<br />
=== Installation: official and AUR ===<br />
<br />
A good selection of {{Pkg|openbox-themes}} are available from the official repositories.<br />
<br />
Both Openbox-specific and Openbox-compatible themes installed from the [[Official_repositories|official repositories]] and/or the [[AUR]] will be automatically installed to the {{ic|/usr/share/themes}} directory. Both will also be immediately available for selection.<br />
<br />
=== Installation: other sources ===<br />
<br />
[http://www.box-look.org/index.php?xcontentmode=7402 box-look.org] is an excellent and well-established source of themes. [http://www.deviantart.com/ deviantART.com] is another excellent resource. Many more can be found through the utilisation of a search engine.<br />
<br />
=== Troubleshooting ===<br />
<br />
There are two particular problems that may be encountered on rare occasions, especially where downloading themes from unsupported websites. These have been addressed below.<br />
<br />
==== Theme cannot be used ====<br />
<br />
If for any reason the newly extracted theme cannot be selected, open the theme directory to first ensure that it is indeed compatible with Openbox by determining that an {{ic|openbox-3}} directory is present, and that within this directory a {{ic|themerc}} file is also present. An {{ic|.obt}} ('''O'''pen'''B'''ox '''T'''heme) file may also be present in some instances, which can then be manually loaded in {{Pkg|obconf}}.<br />
<br />
Where expected files and directories are present and correct, then on occasion it is possible that the theme author has not correctly set permission to access the file (e.g. permission may still be for the account of the author, rather than for '''root'''). To eliminate this possibility, ensure the folder and file permissions are for '''root''':<br />
<br />
# chown -R root /user/share/themes<br />
<br />
==== Theme looks broken ====<br />
<br />
Of course, the first line of enquiry would be to check that it is not just a badly made, broken theme! Otherwise, ensure that the [[Openbox#GTK+ 2|Openbox GTK fix]]{{Dead link|2014|11|28}} has been implemented, and then re-start the session. Unfortunately some older themes can simply break if not maintained sufficiently to keep pace with the changes incurred by [[GTK]] updates. To avoid such occurrences, it is best to check that desired themes have recently been created or at least updated / patched.<br />
<br />
=== Edit or create new themes ===<br />
<br />
{{Tip|Where deciding to modify an existing theme (e.g. the colour scheme), it would be best to work on a copy of it, rather than the original. This will retain the original should anything go wrong, and ensure that your changes are not over-written through an update.}}<br />
<br />
The process of creating new or modifying existing themes is covered extensively at the official [http://openbox.org/wiki/Help:Themes openbox.org] website. {{AUR|obtheme}} is a user-friendly GUI for doing so.<br />
<br />
== Compositing effects ==<br />
<br />
Openbox does not provide native support for [[Wikipedia:Compositing window manager|compositing]], and thus requires an external compositor for this purpose.<br />
<br />
Although compositing is not a necessary component, it may specifically avoid issues such as screen distortion with [[#oblogout|oblogout]], and visual glitches with terminal window transparency. See [[Xorg#Composite]] for common choices.<br />
<br />
== Mouse cursor and application icon themes ==<br />
<br />
See [[Cursor themes]] and [[Icons]] for details.<br />
<br />
== Desktop icons and wallpapers ==<br />
<br />
{{Merge||This section is applicable to most [[window manager]]s when used without [[Desktop environment]]}}<br />
<br />
Openbox does not natively support the use of desktop icons or wallpapers. As a consequence, it will be necessary to install additional applications for this purpose, where desired.<br />
<br />
=== Desktop management using file managers ===<br />
<br />
Some file managers have the capacity to fully '''manage the desktop''', meaning that they may be used to provide wallpapers and enable the use of icons on the desktop. The [[LXDE]] desktop environment itself uses PCManFM for this purpose.<br />
<br />
See [[PCManFM#Desktop_management]] and [[SpaceFM#Desktop_management]].<br />
<br />
=== Wallpaper ===<br />
<br />
See [[List_of_applications#Wallpaper_setters]]<br />
<br />
=== Icon programs ===<br />
<br />
While there are programs dedicated to enabling desktop icons alone, it would seem that they have greater drawbacks than the utilisation of file managers for the task. These programs are discussed briefly, below.<br />
<br />
==== idesk ====<br />
<br />
[[idesk]] is a simple program that can enable icons in addition to managing wallpaper. It will be necessary to create an {{ic|~/.idesktop}} directory, and desktop icons must also be manually created. To use idesk to provide icons, add the following command to the {{ic|~/.config/openbox/autostart}} file:<br />
<br />
idesk &<br />
<br />
==== xfdesktop ====<br />
<br />
{{Pkg|xfdesktop}} is the desktop manager for [[Xfce]]. The [[Thunar]] file manager will also be downloaded as a dependency. Where this is used, the Openbox desktop menu will no longer be accessible by right-clicking the background. <br />
<br />
As such, it will consequently be necessary to access it by other means, such as by [[#Desktop menu|creating a keybind]], and/or by - where permitted - re-configuring an installed panel to use the [[#Desktop menu as a panel menu|desktop menu as a panel menu]]. To use xfdesktop to provide icons, add the following command to the {{ic|~/.config/openbox/autostart}} file:<br />
<br />
xfdesktop &<br />
<br />
=== conky reconfiguration ===<br />
<br />
Particularly where using a file manager to manage the desktop, it will be necessary to edit {{ic|~/.conkyrc}} to change the {{ic|own_window_type}} command in order for [[conky]] to continue to be displayed (where used). The revised command that should be used is:<br />
<br />
own_window_type normal<br />
<br />
== oblogout ==<br />
<br />
See the [[Oblogout]] article for an overview on how to use this useful, graphical logout script.<br />
<br />
== Openbox for multihead users ==<br />
<br />
While Openbox provides better than average multihead support on its own, {{AUR|openbox-multihead-git}} provides a development branch called '''Openbox Multihead''' that gives multihead users per-monitor desktops. This model is not commonly found in floating window managers, but exists mainly in tiling window managers. It is explained well on the [http://xmonad.org/tour.html#workspace Xmonad web site]. Also, please see [https://github.com/BurntSushi/openbox-multihead/blob/multihead/README.MULTIHEAD README.MULTIHEAD] for a more comprehensive description of the new features and configuration options found in Openbox Multihead.<br />
<br />
Openbox Multihead will function like normal Openbox when only a single head is available.<br />
<br />
A downside to using Openbox Multihead is that it breaks the EWMH assumption that one and only one desktop is visible at any time. Thus, existing pagers will not work well with it. To remedy this, you can install {{AUR|pager-multihead-git}} alongside Openbox Multihead. <br />
<br />
Finally, {{AUR|pytyle3-git}} is a new version of [[PyTyle]] that will work with Openbox Multihead.<br />
<br />
Both ''pytyle3'' and ''pager-multihead-git'' will work without Openbox Multihead if only one monitor is active.<br />
<br />
== Tips and tricks ==<br />
<br />
=== Launch a complex command with hotkey ===<br />
<br />
If you need to execute a complex command, use shell functionality.<br />
<br />
Special character replacement are as follows:<br />
<br />
* {{ic|&}}: &amp;amp;<br />
* {{ic|<}}: &amp;lt;<br />
* {{ic|>}}: &amp;gt;<br />
<br />
This example will turn off display immediately and lock screen with {{Pkg|slock}}. It was taken from [https://bbs.archlinux.org/viewtopic.php?pid=903057 this thread].<br />
<keybind key="W-l"><br />
<action name="Execute"><br />
<command>sh -c 'slock &amp;amp; (sleep .5 &amp;amp;&amp;amp; xset dpms force off)'</command><br />
</action><br />
</keybind><br />
<br />
Sometimes one need to specify environment variable for application:<br />
<keybind key="A-F7"><br />
<action name="Execute"><br />
<command>sh -c "LC_ALL=C obconf"</command><br />
</action><br />
</keybind><br />
<br />
Another example will launch application preserving all stdout and stderr output to file:<br />
<keybind key="A-f"><br />
<action name="Execute"><br />
<command>sh -c sh -c "exec gimp &amp;gt;/tmp/gimp.out 2&amp;gt;&amp;amp;1"</command><br />
</action><br />
</keybind><br />
<br />
=== Switch desktops using the mouse ===<br />
<br />
It is possible to switch desktop by moving the mouse cursor to the edges of the screen. First install {{Pkg|xdotool}} and add the following two lines to your {{ic|~/.xinitrc}}:<br />
<br />
xdotool behave_screen_edge --delay 500 left set_desktop --relative -- -1 &<br />
xdotool behave_screen_edge --delay 500 right set_desktop --relative -- +1 &<br />
<br />
=== Set default applications / file associations ===<br />
<br />
See the [[Default applications]] article.<br />
<br />
=== Stop continous mouse wheel desktop switching ===<br />
<br />
By default Openbox switches from the last desktop back to the first desktop on mouse wheel scroll. Use {{ic|<wrap>no</wrap>}} in the {{ic|mousebind}} section to disable this behaviour.<br />
<br />
<context name="Desktop"><br />
<mousebind button="Up" action="Click"><br />
<action name="GoToDesktop"><br />
<to>previous</to><br />
<wrap>no</wrap><br />
</action><br />
</mousebind><br />
<mousebind button="Down" action="Click"><br />
<action name="GoToDesktop"><br />
<to>next</to><br />
<wrap>no</wrap><br />
</action><br />
</mousebind><br />
</context><br />
<br />
=== Ad-hoc window transparency ===<br />
<br />
{{Warning|This may not work where other actions are defined within the action group.}}<br />
The program {{Pkg|transset-df}} is available in the official repositories, and can enable window transparency on-the-fly.<br />
<br />
For example, using the following code in the {{ic|<mouse>}} section of the {{ic|~/.config/openbox/rc.xml}} file will enable control of application window transparency by hovering the mouse-pointer over the title bar and scrolling with the middle button:<br />
<br />
<context name="Titlebar"><br />
...<br />
<mousebind button="Up" action="Click"><br />
<action name= "Execute" ><br />
<execute>transset-df -p .2 --inc </execute><br />
</action><br />
</mousebind><br />
<mousebind button="Down" action="Click"><br />
<action name= "Execute" ><br />
<execute>transset-df -p .2 --dec </execute><br />
</action><br />
</mousebind><br />
...<br />
</context><br />
<br />
=== Using obxprop for faster configuration ===<br />
<br />
The {{Pkg|openbox}} package provides a {{ic|obxprop}} binary that can parse relevant values for applications settings in {{ic|rc.xml}}. Officially {{ic|<nowiki>obxprop | grep "^_OB_APP"</nowiki>}} is recommended for this task. Start the process by running the command shown, then click a window to see its properties in the terminal.<br />
<br />
=== Xprop values for applications ===<br />
<br />
{{Pkg|xorg-xprop}} is available in the official repositories, and can be used to relay property values for selected applications. Where frequently using per-application settings, the following [[Bash#Aliases|Bash Alias]] may be useful:<br />
dy:<br />
<br />
alias xp='xprop | grep "WM_WINDOW_ROLE\|WM_CLASS" && echo "WM_CLASS(STRING) = \"NAME\", \"CLASS\""'<br />
<br />
To use Xorg-XProp, run using the alias given {{ic|xp}}, and click on the active program desired to define with per-application settins. The results displayed will only be the information that Openbox itself requires, namely the {{ic|WM_WINDOW_ROLE}} and {{ic|WM_CLASS}} (name and class) values:<br />
<br />
WM_WINDOW_ROLE(STRING) = "roster"<br />
WM_CLASS(STRING) = "gajim.py", "Gajim.py"<br />
WM_CLASS(STRING) = "NAME", "CLASS"<br />
<br />
==== Firefox ====<br />
<br />
For whatever reason, Firefox and like-minded equivalents ignore application rules (e.g. ''<desktop>'') unless {{ic|class&#61;"Firefox*"}} is used. This applies irrespective of whatever values '''xprop''' may report for the program's {{ic|WM_CLASS}}.<br />
<br />
=== Switching between keyboard layouts ===<br />
<br />
See the article section [[Keyboard configuration in Xorg#Switching between keyboard layouts|switching between keyboard layouts]] for instructions.<br />
<br />
=== Set grid layout for virtual desktops ===<br />
<br />
Install {{AUR|obsetlayout}}. To set a 2x2 grid for example:<br />
<br />
obsetlayout 0 2 2 0<br />
<br />
Run it without arguments to know what the arguments mean.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Windows load behind the active window ===<br />
<br />
Some application windows (such as Firefox windows) may load behind the currently active window, causing you to need to switch to the window you just created to focus it. To fix this behavior add this to your {{ic|~/.config/openbox/rc.xml}} file, inbetween the {{ic|1=<openbox_config>}} and {{ic|1=</openbox_config>}} tags:<br />
<br />
{{bc|1=<br />
<applications><br />
<application class="*"><br />
<focus>yes</focus><br />
</application><br />
</applications><br />
}}<br />
<br />
== See also ==<br />
<br />
* [http://openbox.org/ Openbox Website] - Official website<br />
* [http://www.box-look.org/ Box-Look.org] - A good resource for themes and related artwork<br />
* [https://bbs.archlinux.org/viewtopic.php?id=93126 Openbox Hacks and Configs Thread] @ Arch Linux Forums<br />
* [https://bbs.archlinux.org/viewtopic.php?id=45692 Openbox Screenshots Thread] @ Arch Linux Forums<br />
* [http://urukrama.wordpress.com/openbox-guide/ An Openbox guide]</div>Akleop