Difference between revisions of "Openbox"

From ArchWiki
Jump to navigation Jump to search
m (no more plus in gtk)
 
(204 intermediate revisions by 53 users not shown)
Line 2: Line 2:
 
[[cs:Openbox]]
 
[[cs:Openbox]]
 
[[de:Openbox]]
 
[[de:Openbox]]
 +
[[el:Openbox]]
 
[[es:Openbox]]
 
[[es:Openbox]]
 
[[fr:Openbox]]
 
[[fr:Openbox]]
Line 13: Line 14:
 
[[sk:Openbox]]
 
[[sk:Openbox]]
 
[[sr:Openbox]]
 
[[sr:Openbox]]
[[tr:Openbox]]
+
[[zh-hans:Openbox]]
[[zh-CN:Openbox]]
+
[[zh-hant:Openbox]]
[[zh-TW:Openbox]]
 
 
{{Related articles start}}
 
{{Related articles start}}
 
{{Related|Desktop environment}}
 
{{Related|Desktop environment}}
 
{{Related|Display manager}}
 
{{Related|Display manager}}
 
{{Related|File manager functionality}}
 
{{Related|File manager functionality}}
{{Related|Window manager}}
+
{{Related|Xdg-menu}}
 
{{Related|Oblogout}}
 
{{Related|Oblogout}}
 
{{Related articles end}}
 
{{Related articles end}}
  
Openbox is a lightweight, powerful, and highly configurable ''stacking'' [[Window manager|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.
+
[http://openbox.org/wiki/Main_Page 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.
 
 
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.
 
  
 
== Installation ==
 
== Installation ==
  
Install {{Pkg|openbox}}, available in the [[official repositories]].
+
[[Install]] the {{Pkg|openbox}} package.
  
== Openbox Sessions ==
+
== Starting ==
 
 
Again, Openbox may be run independently as a standalone window manager, or within other integrated desktop environments such as [[KDE]] and [[XFCE]] as an alternative to the window managers they provide.
 
  
 
=== Standalone ===
 
=== Standalone ===
  
Many popular [[Display manager|display managers]] such as [[LXDM]], [[SLiM]], and [[LightDM]] will automatically detect Openbox, allowing for it to be run as a standalone session.
+
Run {{ic|openbox}} or {{ic|openbox-session}} with [[xinit]]. Note that only {{ic|openbox-session}} provides [[#Autostart]].
 
 
However, it may be necessary to manually specify the command to start an openbox session where intending to set it as a default session for [[SLiM]], or where not using a display manager at all (e.g. logging in at the command line, followed by the command {{ic|startx}}). In either instance, it will be necessary to modify the [[Xinitrc]] file in order to add the following command:
 
 
 
exec openbox-session
 
 
 
=== Within other desktop environments ===
 
 
 
When replacing the native window manager of a desktop environment with Openbox, any desktop compositing effects - such a transparency - provided by that native window manager will be lost. This is because Openbox itself does not provide any compositing functionality. However, it is easily possible to use a separate compositing program to [[Openbox#Compositing effects|re-enable compositing]].  
 
  
==== GNOME ====
+
{{Note|After executing openbox-session, there is only a blank grey screen. Try to move your mouse and '''right click''' to get an openbox menu to make sure that it is actually working.}}
  
Openbox does not seem to work with [[GNOME|GNOME 3]]. The {{ic|Gnome-Shell}} touch-style interface requires both its native window manager and its native gtk-window-decorator packages to function. Furthermore, attempting to run Openbox within the {{ic|Classic-Gnome-Shell}} interface results in the loss of the {{ic|gnome-panel}}. Ceasing Openbox and attempting to restore the native window manager will result in crashing the desktop. Gnome 3 is tightly integrated, and is therefore deliberately designed not to be modular in nature (i.e. allowing components to be changed).
+
=== Other desktop environments ===
  
==== KDE ====
+
{{Note|
See the [[KDE#Using Openbox in KDE|using Openbox in KDE]] section of the main [[KDE]] article.
+
* 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]].
 +
* Openbox does work with GNOME applications (but see [[GTK#Client-side decorations]]). [http://comments.gmane.org/gmane.comp.window-managers.openbox/6595]}}
  
==== Xfce ====
+
See [[Desktop environment#Use a different window manager]].
  
See the [[Xfce#Replacing_the_native_window_manager|replacing the native window manager]] section of the main [[Xfce]] article.
+
== Configuration==
  
== System configuration==
+
{{Note|Local configuration files will always override global equivalents.}}
  
Those installing Openbox - particularly as a stand-alone Window Manager - will have noticed that several elements may fail to work properly, or even work at all. Examples of the common problems encountered are:
+
Four key files form the basis of the [http://openbox.org/wiki/Configuration 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:
 
 
* '''File Managers''': Other partitions are not displayed or accessible. The trash function - where provided - does not work
 
* '''Authentication''': Passwords are not stored / remembered during sessions
 
* '''Secure Shell (SSH)''': SSH agent will not start
 
* '''Wireless Connection''': Instant failure when attempting to connect to wifi (related to authentication)
 
* '''Themes''': Application windows are mismatched or haphazard-looking
 
* '''Folders''': Expected folders such as {{ic|Documents}}, {{ic|Downloads}} and so forth are missing from the {{ic|Home}} folder
 
* '''System Tray''': Installed packages fail to autostart or can be seen running twice
 
 
 
Most of these problems are actually the result of [[Dbus]] and [[GTK]] issues, both of which can be fixed simultaneously by editing the [[xprofile|~/.xprofile]] file - or if using [[SLiM]] as a [[display manager]] instead - by editing the [[xinitrc|~/.xinitrc]] file. It will also be necessary to install some key packages to ensure full functionality.
 
 
 
=== D-Bus ===
 
 
 
File manager, authentication, SSH agent, and WiFi-connection problems will likely be due to that [[D-Bus]] is not functioning correctly. Most [[display manager]]s such as [[GDM]], [[KDM]], [[LightDM]] and [[LXDM]] will handle this for you.
 
 
 
When using [[xinit]] or certain other DMs (such as [[XDM]] and [[SLiM]]), make sure {{ic|~/.xinitrc}} is based on {{ic|/etc/skel/.xinitrc}} (so that it sources {{ic|/etc/X11/xinit/xinitrc.d/}}, see [[xinitrc]] for more information).
 
 
 
=== GTK+ 2 ===
 
 
 
Problems with the theme and look will likely be due to the absence of the appropriate command to ensure that a uniform look must be applied to applications that use GTK 2. Again, edit {{ic|~/.xinitrc}} and/or {{ic|~/.xprofile}} with the following command:
 
 
 
export GTK2_RC_FILES="$HOME/.gtkrc-2.0"
 
 
 
The {{ic|~/.gtkrc-2.0}} file will be automatically generated where using [[LXDE|lxappearance]] to set themes.
 
 
 
It will also be necessary to install {{Pkg|libgnomeui}} to ensure that [[Qt]] is also able to find GTK themes.
 
 
 
See [[GTK+#GTK+ 2.x]] for an introduction to manually editing {{ic|~/.gtkrc-2.0}}.
 
 
 
=== XDG ===
 
 
 
In addition to sourcing the '''local''' {{ic|~/.config/openbox/autostart}} file to autostart applications, Openbox will also source {{ic|.desktop}} files automatically installed by some packages in the '''global''' {{ic|/etc/xdg/autostart}} directory. The package responsible for allowing Openbox to additionally source the {{ic|/etc/xdg/autostart}} directory is {{Pkg|python2-xdg}}.
 
 
 
For example, where initially autostarting a package such as the [[NetworkManager|Network Manager]] applet ('''nm-applet''') locally, should {{Pkg|python2-xdg}} be installed at a later time - either explicitly or as a dependency for another package - its global XDG {{ic|.desktop}} file will then also be sourced as a consequence, resulting in seeing two icons running in the system tray. It is therefore recommended to install {{Pkg|python2-xdg}} explicitly, as this will ensure that applications that should automatically autostart when installed will do so.
 
 
 
=== Home folders ===
 
 
 
{{Tip|This fix will be especially helpful for those who wish to use a file manager to manage their desktop, as it will automatically create a special {{ic|~/Desktop}} directory, which will house all files and application shortcuts stored on the desktop itself.}}
 
 
 
Where expected {{ic|Home}} folders such as {{ic|Downloads}}, {{ic|Documents}}, etc., are not present, then please review the [[Xdg user directories]] article.
 
 
 
=== Authentication and passwords ===
 
 
 
For authentication (e.g. WiFi passwords, etc.), it will be necessary to install the appropriate packages. They are:
 
 
 
* {{Pkg|polkit}}:  Application development toolkit for controlling system-wide privileges; see [[polkit]]
 
* {{Pkg|lxpolkit}}: Simple policykit authentication agent for LXDE ({{Pkg|polkit-gnome}} currently does not work properly)
 
* {{Pkg|gnome-keyring}}: store / remember passwords; see [[GNOME Keyring]]
 
 
 
== Configuration ==
 
 
 
{{Warning|Edit these files as the user you will be using Openbox with. Not as root!}}
 
{{Tip|Local configuration files will always override global equivalents. These files may also be manually edited by any appropriate text editor, such as Leafpad or Geany; there is no need to use [[sudo]] or '''gksu''' commands to edit them.}}
 
 
 
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:
 
  
 
  $ mkdir -p ~/.config/openbox
 
  $ mkdir -p ~/.config/openbox
  $ cp -R /etc/xdg/openbox/* ~/.config/openbox
+
  $ cp -a /etc/xdg/openbox/. ~/.config/openbox/
  
 
=== rc.xml ===
 
=== rc.xml ===
Line 133: Line 67:
  
 
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.
 
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.
 +
 +
{{Note|Per-application settings pertaining to fixed placement of applications per monitor will only work if the x & y position have also been defined.}}
  
 
=== menu.xml ===
 
=== menu.xml ===
  
{{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.  
+
{{ic|~/.config/openbox/menu.xml}} defines the type and behaviour of the desktop menu, accessible 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.  
  
The available options are discussed extensively below in the [[Openbox#Menus|Menus]] section.
+
The available options are discussed extensively below in the [[#Menus]] section.
  
=== autostart ===
+
=== Autostart ===
  
{{Tip|Be aware that some applications will automatically start via {{ic|.desktop}} files installed in the {{ic|/etc/xdg/autostart/}} or {{ic|~/.config/autostart/}} directories.}}
+
{{ic|openbox-session}} provides two autostart mechanisms: [[XDG Autostart]] (which only works if {{Pkg|python2-xdg}} is installed) and [http://openbox.org/wiki/Help:Autostart Openbox's own autostart mechanism].
  
{{ic|~/.config/openbox/autostart}} determines which applications are to be launched upon beginning the Openbox session. These may include:
+
Openbox's own autostart mechanism:
  
* Panels and/or docks
+
* sources {{ic|/etc/xdg/openbox/environment}}
* Compositors
+
* sources {{ic|~/.config/openbox/environment}}
* Background providers
+
* runs {{ic|/etc/xdg/openbox/autostart}}
* Screensavers
+
* runs {{ic|~/.config/openbox/autostart}}
* Applications to autoload or autostart (e.g. [[Conky]])
 
* [[Daemon]] processes (e.g. File Managers for automounting and other functions)
 
* Other appropriate commands (e.g. disable [[DPMS]])
 
  
==== Listing commands ====
+
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:
  
There are two very important points to note when adding commands to the {{ic|~/.config/openbox/autostart}} file:
+
xset -b
 +
(sleep 3s && nm-applet) &
 +
(sleep 3s && conky) &
  
* Each and every command '''must''' be terminated with an ampersand ({{ic|&}}). Where a command does not end with an ampersand, then no further commands listed below it will be executed.
+
=== environment ===
* It is strongly recommended to add delays to the execution of some or all commands in the autostart file, even if only by a single second. The consequence of not doing so is that all commands will be executed simultaneously, potentially resulting in the mis- or non-starting of items. The syntax of the command to delay the execution of commands (in seconds) is:
 
  
(sleep <number of seconds>s && <command>) &
+
{{ic|~/.config/openbox/environment}} can be used to export and set relevant environmental variables such as to:
  
For example, to delay the execution of [[Conky]] by 3 seconds, the command would be (and note the termination of it with an ampersand):
+
* Define new pathways (e.g. execute commands that would otherwise require the entire pathway to be listed with them)
 +
* Change language settings, and
 +
* Define other variables to be used (e.g. the fix for GTK theming could be listed here)
  
(sleep 3s && conky) &
+
=== Themes ===
  
Here is a more complete example of a possible {{ic|~/.config/openbox/autostart}} file:
+
Install {{Pkg|obconf}} and/or {{Pkg|lxappearance-obconf}} for a GUI to configure visual settings and theming.
  
## Autostart File ##
+
A good selection of themes are available in the {{AUR|openbox-themes}} package or the [[AUR]]. Some [[GTK#Themes]] come with an Openbox theme as well. Both Openbox-specific and Openbox-compatible themes will be installed to the {{ic|/usr/share/themes}} directory and will also be immediately available for selection.
 
##Disable DPMS
 
xset -dpms; xset s off &
 
 
##Compositor
 
compton -CGb &
 
 
##Background
 
(sleep 1s && nitrogen --restore) &
 
 
##tint2 panel
 
(sleep 1s && tint2) &
 
 
##Sound Icon
 
(sleep 1s && volumeicon) &
 
 
##Screensaver
 
(sleep 1s && xscreensaver -no-splash) &
 
 
##Conky
 
(sleep 3s && conky) &
 
 
##Disable touchpad
 
/usr/bin/synclient TouchpadOff=1 &
 
  
=== environment ===
+
[https://www.box-look.org/browse/ord/latest/ 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 online.
  
{{Note|This is the least important file, and many users may not need to edit it at all.}}
+
==== Edit or create ====
  
{{ic|~/.config/openbox/environment}} can be used to export and set relevant environmental variables such as to:
+
{{Tip|It's better to copy a theme to your home directory than to edit those found in {{ic|/usr/share/themes/}}. This will retain the original should anything go wrong and ensure that your changes are not overwritten on update.}}
  
* Define new pathways (e.g. execute commands that would otherwise require the entire pathway to be listed with them)
+
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.
* Change language settings, and
 
* Define other variables to be used (e.g. the fix for GTK theming could be listed here)
 
  
=== Optional GUI configuration packages ===
+
=== GUI configuration ===
  
Several GUIs are available to quickly and easily configure your Openbox desktop. From the official repositories these include:
+
Several GUI applications are available to quickly and easily configure your Openbox desktop.
  
* {{Pkg|obconf}}: Basic Openbox configuration manager
+
* {{App|ObConf|A GTK2 based configuration tool for the Openbox window manager.|http://openbox.org/wiki/ObConf:About|{{Pkg|obconf}}}}
* {{Pkg|lxappearance-obconf}}: LXDE configuration manager (provides additional options)
+
* {{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}}}}
* {{Pkg|lxinput}}: LXDE keyboard and mouse configuration
+
* {{App|LXInput|LXDE keyboard and mouse configuration|http://lxde.org|{{Pkg|lxinput}}}}
* {{Pkg|lxrandr}}: LXDE monitor configuration
+
* {{App|LXRandR|LXDE monitor configuration.|http://wiki.lxde.org/en/LXRandR|{{Pkg|lxrandr}}}}
 +
* {{App|obkey|Configure Openbox keyboard shortcuts|https://code.google.com/p/obkey/|{{AUR|obkey}}}}
 +
* {{App|ob-autostart|A simple autostart application for Openbox.|http://pastebin.com/012YgXTk|{{AUR|ob-autostart}}}}
 +
* {{App|obapps|Graphical tool for configuring application settings in Openbox.|https://sourceforge.net/projects/obapps/|{{AUR|obapps}}}}
  
Others, such as {{AUR|obkey}} (configure keyboard shortcuts via the {{ic|rc.xml}} file) and {{AUR|ob-autostart}} (configure the Openbox {{ic|autostart}} file) are available from the [[AUR]]. Programs and applications relating to the configuration of Openbox's desktop menu are discussed in the [[Openbox#Menus|Menus]] section.
+
Programs and applications relating to the configuration of Openbox's desktop menu are discussed in the [[#Menus|Menus]] section.
  
 
== Openbox reconfiguration ==
 
== Openbox reconfiguration ==
Line 224: Line 137:
 
  $ openbox --reconfigure
 
  $ openbox --reconfigure
  
Where intending to add this command as a keybinnd 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:
+
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:
  
 
  <keybind key="W-F11">
 
  <keybind key="W-F11">
Line 232: Line 145:
 
== Keybinds ==
 
== Keybinds ==
  
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]. There is a utility 'obkey' in AUR for adjust key-binding. Before use obkey, you should use obconf to create {{ic|~/.config/openbox/rc.xml}}.
+
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].  
 +
 
 +
Keybinds can be added to the configuration file using the following syntax:
 +
 
 +
<keybind key="'''my-key-combination'''">
 +
  <action name="'''my-action'''">
 +
    '''...'''
 +
  </action>
 +
</keybind>
 +
 
 +
The action name for running an external command is ''Execute''. Use the following syntax to define an external command to execute:
  
=== Special keys ===
+
<action name="Execute">
 +
  <command>'''my-command'''</command>
 +
</action>
  
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.
+
See [http://openbox.org/wiki/Help:Actions the Openbox wiki] for a list of all available actions.
  
==== Modifiers ====
+
{{Tip|The {{AUR|obkey}} utility provides a graphical interface for configuring key bindings. Before using ''obkey'', you should use ''obconf'' to create {{ic|~/.config/openbox/rc.xml}}.}}
  
{{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:
+
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|modifiers}}, {{ic|multimedia}} and {{ic|navigation}}.
 +
 
 +
=== Modifiers ===
 +
 
 +
{{ic|Modifier}} 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 modifiers 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 modifier with another key is:
  
 
  "<modifier>-<key>"
 
  "<modifier>-<key>"
  
The modifer codes are as follows:
+
The modifier codes are as follows:
  
 
* {{ic|S}}: Shift
 
* {{ic|S}}: Shift
Line 251: Line 180:
 
* {{ic|W}}: Super / Windows
 
* {{ic|W}}: Super / Windows
 
* {{ic|M}}: Meta
 
* {{ic|M}}: Meta
* {{ic|H}}: Hyper (If it is bound to something)  
+
* {{ic|H}}: Hyper (If it is bound to something)
  
For example, the code below would use {{ic|super}} and {{ic|t}} to launch {{Pkg|lxterminal}}
+
=== Multimedia keys ===
  
<keybind key="W-t">
+
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.
    <action name="Execute">
 
        <command>lxterminal</command>
 
    </action>
 
</keybind>
 
 
 
==== Multimedia keys ====
 
 
 
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 the [[Multimedia Keys]] article for further information.
 
  
 
The volume and brightness multimedia codes are as follows (note that commands will still have to be assigned to them to actually function):
 
The volume and brightness multimedia codes are as follows (note that commands will still have to be assigned to them to actually function):
Line 270: Line 191:
 
* {{ic|XF86AudioLowerVolume}}: Decrease volume
 
* {{ic|XF86AudioLowerVolume}}: Decrease volume
 
* {{ic|XF86AudioMute}}: Mute / unmute volume
 
* {{ic|XF86AudioMute}}: Mute / unmute volume
* {{ic|XF86MonBrightnessUp}}: Increase screen brightess
+
* {{ic|XF86MonBrightnessUp}}: Increase screen brightness
 
* {{ic|XF86MonBrightnessDown}}: Decrease screen brightness
 
* {{ic|XF86MonBrightnessDown}}: Decrease screen brightness
  
Examples of how these may be used in {{ic|~/.config/openbox/rc.xml}} have been provided below.
+
For a full list of XF86 multimedia keys, see the [http://wiki.linuxquestions.org/wiki/XF86_keyboard_symbols LinuxQuestions wiki].
 +
 
 +
==== Volume control ====
 +
 
 +
What commands should be used for controlling the volume will depend on whether [[ALSA]], [[PulseAudio]], or [[OSS]] is used for sound.
 +
 
 +
*ALSA: see [[Advanced Linux Sound Architecture#Keyboard volume control]].
 +
*PulseAudio: see [[PulseAudio#Keyboard volume control]]
 +
*OSS: see [[OSS#Using multimedia keys with OSS]].
  
==== Navigation keys ====
+
=== Navigation keys ===
  
 
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:
 
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:
Line 283: Line 212:
 
* {{ic|Left}}: Left
 
* {{ic|Left}}: Left
 
* {{ic|Right}}: Right
 
* {{ic|Right}}: Right
 
=== Volume Control ===
 
 
What commands should be used for controlling the volume will depend on whether [[ALSA]], [[PulseAudio]], or [[OSS]] is used for sound.
 
 
==== ALSA ====
 
 
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):
 
 
<keybind key="XF86AudioRaiseVolume">
 
    <action name="Execute">
 
        <command>amixer set Master 5%+ unmute</command>
 
    </action>
 
</keybind>
 
<keybind key="XF86AudioLowerVolume">
 
    <action name="Execute">
 
        <command>amixer set Master 5%- unmute</command>
 
    </action>
 
</keybind>
 
<keybind key="XF86AudioMute">
 
    <action name="Execute">
 
        <command>amixer set Master toggle</command>
 
    </action>
 
</keybind>
 
 
==== Pulseaudio ====
 
 
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:
 
 
<keybind key="XF86AudioRaiseVolume">
 
    <action name="Execute">
 
        <command>amixer -D pulse set Master 5%+ unmute</command>
 
    </action>
 
</keybind>
 
<keybind key="XF86AudioLowerVolume">
 
    <action name="Execute">
 
        <command>amixer -D pulse set Master 5%- unmute</command>
 
    </action>
 
</keybind>
 
<keybind key="XF86AudioMute">
 
    <action name="Execute">
 
        <command>amixer -D pulse set Master toggle</command>
 
    </action>
 
</keybind>
 
 
==== OSS ====
 
 
{{Note|This option may be suitable for more experienced users.}}
 
 
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.
 
 
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:
 
 
<keybind key="[chosen keybind]">
 
    <action name="Execute">
 
        <command>ossmix -- mpd +1</command>
 
    </action>
 
</keybind>
 
<keybind key="[chosen keybind]">
 
    <action name="Execute">
 
        <command>ossmix -- mpd -1</command>
 
    </action>
 
</keybind>
 
 
=== Media player control ===
 
 
The {{AUR|playerctl}} command-line utility can be used to bind multimedia keys to player actions. It should work with most media players.
 
 
<keybind key="XF86AudioPlay">
 
    <action name="Execute">
 
        <command>playerctl play</command>
 
    </action>
 
</keybind>
 
<keybind key="XF86AudioPause">
 
    <action name="Execute">
 
        <command>playerctl pause</command>
 
    </action>
 
</keybind>
 
<keybind key="XF86AudioNext">
 
    <action name="Execute">
 
        <command>playerctl next</command>
 
    </action>
 
</keybind>
 
<keybind key="XF86AudioPrev">
 
    <action name="Execute">
 
        <command>playerctl previous</command>
 
    </action>
 
</keybind>
 
 
=== Brightness control ===
 
 
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%:
 
 
<keybind key="XF86MonBrightnessUp">
 
      <action name="Execute">
 
        <command>xbacklight +10</command>
 
      </action>
 
</keybind>
 
<keybind key="XF86MonBrightnessDown">
 
      <action name="Execute">
 
        <command>xbacklight -10</command>
 
      </action>
 
</keybind>
 
 
=== Window snapping ===
 
 
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.
 
 
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:
 
 
<keybind key="W-Left">
 
    <action name="UnmaximizeFull"/>
 
    <action name="MaximizeVert"/>
 
    <action name="MoveResizeTo">
 
        <width>50%</width>
 
    </action>
 
    <action name="MoveToEdge"><direction>west</direction></action>
 
</keybind>
 
<keybind key="W-Right">
 
    <action name="UnmaximizeFull"/>
 
    <action name="MaximizeVert"/>
 
    <action name="MoveResizeTo">
 
        <width>50%</width>
 
    </action>
 
    <action name="MoveToEdge"><direction>east</direction></action>
 
</keybind>
 
 
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:
 
 
<keybind key="W-Down">
 
    <action name="Unmaximize"/>
 
</keybind>
 
<keybind key="W-Up">
 
    <action name="Maximize"/>
 
</keybind>
 
 
This [http://ubuntuforums.org/showthread.php?t=1796793 Ubuntu forum thread] provides more information. Applications such as {{AUR|opensnap-git}} are also available from the AUR to automatically simulate window snapping behaviour without the use of keybinds.
 
 
=== Desktop menu ===
 
 
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}}:
 
 
<keybind key="C-m">
 
    <action name="ShowMenu">
 
        <menu>root-menu</menu>
 
    </action>
 
</keybind>
 
  
 
== Menus ==
 
== Menus ==
Line 445: Line 227:
 
==== menumaker ====
 
==== menumaker ====
  
{{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.}}
+
{{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.
 
 
{{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.
 
  
 
Once installed and executed, it will automatically generate a new {{ic|~/.config/openbox/menu.xml}} file. To avoid overwriting an existing file, enter:
 
Once installed and executed, it will automatically generate a new {{ic|~/.config/openbox/menu.xml}} file. To avoid overwriting an existing file, enter:
Line 457: Line 237:
 
  $ mmaker -vf OpenBox3
 
  $ mmaker -vf OpenBox3
  
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}}.
+
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 {{AUR|obmenu}}.
  
 
==== obmenu ====
 
==== obmenu ====
  
{{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.}}
+
{{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.}}
  
{{Pkg|obmenu}} is a "user-friendly" GUI application to edit {{ic|~/.config/openbox/menu.xml}}, without the need to code in {{ic|xml}}.
+
{{AUR|obmenu}} is a "user-friendly" GUI application to edit {{ic|~/.config/openbox/menu.xml}}, without the need to code in {{ic|xml}}.
  
 
==== xdg-menu ====
 
==== xdg-menu ====
Line 471: Line 251:
 
==== logout menu options ====
 
==== logout menu options ====
  
{{Tip|The commands provided can also be attached to [[Openbox#Keybinds|keybinds]].}}
+
{{Tip|The commands provided can also be attached to [[#Keybinds|keybinds]].}}
  
The {{ic|~/.config/openbox/menu.xml}} file can be edited in order to provide a sub-menu with the same options as provided by [[Openbox#oblogout|oblogout]]. The sample script below will provide all of these options, with the exception of the ability to lock the screen:
+
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:
  
 
  <menu id="exit-menu" label="Exit">
 
  <menu id="exit-menu" label="Exit">
Line 517: Line 297:
 
* {{AUR|openbox-xdgmenu}}: fast xdg-menu converter to xml-pipe-menu
 
* {{AUR|openbox-xdgmenu}}: fast xdg-menu converter to xml-pipe-menu
 
* {{AUR|obfilebrowser}}: Application and file browser
 
* {{AUR|obfilebrowser}}: Application and file browser
* {{AUR|obdevicemenu}}: Management of removable media with [[Udisks#Udisks|Udisks]]
+
* {{AUR|obdevicemenu}}: Management of removable media with [[Udisks]]
 
* [https://bbs.archlinux.org/viewtopic.php?pid=1345031 wifi pipe menu]: Wireless networking using [[Netctl]]
 
* [https://bbs.archlinux.org/viewtopic.php?pid=1345031 wifi pipe menu]: Wireless networking using [[Netctl]]
  
[http://openbox.org/download-pipemenus.php Openbox.org] also provides a further list of pipe menus.
+
[http://openbox.org/wiki/Openbox:Pipemenus Openbox.org] also provides a further list of pipe menus.
  
 
=== Generators ===
 
=== Generators ===
  
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.
+
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.
  
 
A menu generator will have to be executed from the {{ic|~/.config/openbox/menu.xml}} file.
 
A menu generator will have to be executed from the {{ic|~/.config/openbox/menu.xml}} file.
Line 532: Line 312:
 
{{Tip|icons can still be disabled in {{AUR|obmenu-generator}}, even where enabled in {{ic|~/.config/openbox/rc.xml}}.}}
 
{{Tip|icons can still be disabled in {{AUR|obmenu-generator}}, even where enabled in {{ic|~/.config/openbox/rc.xml}}.}}
  
{{AUR|obmenu-generator}} is currently only available from the [[AUR]], although it is still highly recommended. 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.
+
{{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.
  
 
Below is an example of how obmenu-generator would be dynamically executed without icons in {{ic|~/.config/openbox/menu.xml}}:
 
Below is an example of how obmenu-generator would be dynamically executed without icons in {{ic|~/.config/openbox/menu.xml}}:
Line 550: Line 330:
 
{{Tip|If this menu produces an error, it may be solved by enabling icons in {{ic|~/.config/openbox/rc.xml}}.}}
 
{{Tip|If this menu produces an error, it may be solved by enabling icons in {{ic|~/.config/openbox/rc.xml}}.}}
  
{{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.
+
{{AUR|openbox-menu}} uses the [[LXDE]] [http://sourceforge.net/projects/lxde/files/menu-cache/ menu-cache] to create dynamic menus. The [http://fabrice.thiroux.free.fr/openbox-menu_en.html official homepage] provides further information and screenshots.
 
 
==== obmenugen ====
 
 
 
{{AUR|Obmenugen}} is currently only available from the [[AUR]], and 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.
 
  
 
=== Menu icons ===
 
=== Menu icons ===
Line 570: Line 346:
 
{{Tip|XDoTool can simulate any keybind for any action, and as such, it may therefore be used for many other purposes...}}
 
{{Tip|XDoTool can simulate any keybind for any action, and as such, it may therefore be used for many other purposes...}}
  
{{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:
+
[[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:
  
 
* Replace an existing panel menu
 
* Replace an existing panel menu
* Implement a panel menu where otherwise not provided or possible (e.g. for {{AUR|tint2-svn}})
+
* Implement a panel menu where otherwise not provided or possible (e.g. for [[Tint2]])
* Compensate where losing access to the desktop menu due to the use of an application like [[Openbox#xfdesktop|xfdesktop]] to [[Openbox#Desktop_Icons_and_Wallpapers|manage the desktop]].
+
* Compensate where losing access to the desktop menu due to the use of an application like {{pkg|xfdesktop}} to manage the [[#Desktop icons and wallpapers|desktop]].
  
 
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}}:
 
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}}:
Line 584: Line 360:
 
  </keybind>
 
  </keybind>
  
Openbox must then be [[Openbox#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|-}}):
+
Openbox must then be [[#Openbox reconfiguration|reconfigured]]. 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|-}}):
  
 
  xdotool key control+m
 
  xdotool key control+m
Line 600: Line 376:
 
  $ chmod +x ~/.config/obpanelmenu.sh
 
  $ chmod +x ~/.config/obpanelmenu.sh
  
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]].
+
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.
  
== GTK+ desktop theming ==
+
=== XDG compliant menu ===
  
{{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 the [[Openbox#GTK+ 2|GTK fix]] section).}}
+
A xdg compliant menu is based on the freedesktop.org standard. The menu is defined in menu-files which reside in /etc/xdg/menus. New applications will occur automatically in the menu.
  
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. For example, {{AUR|gtk-theme-numix-blue}} supports both Openbox and [[XFCE]].
+
==== Examples ====
  
=== Configuration ===
+
* [https://github.com/mlde/californium californium]: xdg menu based on the LXQt main menu and easily themable
  
{{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]].
+
== Tips and tricks ==
  
=== Installation: official and AUR ===
+
=== Cursor and icon themes ===
  
A good selection of {{Pkg|openbox-themes}} are available from the official repositories.
+
See [[Cursor themes]] and [[Icons]] for details.
  
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.
+
=== Desktop icons and wallpapers ===
  
=== Installation: other sources ===
+
Openbox does not natively support the use of desktop icons or wallpapers.
  
[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.
+
See [[PCManFM#Desktop management|PCManFM]], [[SpaceFM#Desktop management|SpaceFM]] and [[Idesk]].
  
==== Zip and tar files ====
+
{{note|You may have to edit {{ic|~/.conkyrc}} and set {{ic|own_window_type}} to {{ic|normal}}.}}
  
Themes downloaded from other sources such as [http://box-look.org/ box-look.org] will usually be compressed in a {{ic|.tar.gz}} or {{ic|.zip}} format. Although [[tar]] will have been installed as part of the base arch installation to extract {{ic|.tar.gz}} files, it will be necessary to install a program such as {{Pkg|unzip}} to extract {{ic|.zip}} files in the terminal. user-friendly GUI archivers are also available; see [[List of applications#Compression_tools]] for further information.
+
See [[List of applications#Wallpaper setters]].
  
Extracted theme files should also be placed in the {{ic|/usr/share/themes}} directory. For example, assuming downloaded content is automatically stored in the {{ic|~/Downloads}} folder, to simultaneously extract and move a {{ic|.tar.gz}} theme file, the syntax of the command would be:
+
=== Compositing effects ===
  
# tar xvf ~/Downloads/<theme file name>.tar.gz -C /usr/share/themes/
+
Openbox does not provide native support for [[Wikipedia:Compositing window manager|compositing]], and thus requires an external compositor for this purpose.
  
To use {{Pkg|unzip}} in the same scenario for a {{ic|.zip}} theme file, the syntax of the command would be:
+
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.
  
# unzip ~/Downloads/<theme file name>.zip -d /usr/share/themes/
+
=== oblogout ===
  
Alternatively, it is also possible to simply move / copy and paste the extracted files to the {{ic|/usr/share/themes}} directory using an installed file manager as '''root'''.
+
See the [[Oblogout]] article for an overview on how to use this useful, graphical logout script.
  
=== Troubleshooting ===
+
=== Openbox for multihead users ===
  
There are two particular problems that may be encountered on rare occasions, especially where downloading themes from unsupported websites. These have been addressed below.
+
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 [[Window_manager#Types|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.
  
==== Theme cannot be used ====
+
Openbox Multihead will function like normal Openbox when only a single head is available.
  
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}}.
+
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}}{{Broken package link|{{aur-mirror|pager-multihead-git}}}} alongside Openbox Multihead. It will work without Openbox Multihead if only one monitor is active.
  
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''':
+
=== Launch a complex command with hotkey ===
  
# chown -R root /user/share/themes
+
If you need to execute a complex command, use shell functionality.
  
==== Theme looks broken ====
+
Special character replacement are as follows:
  
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]] 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.
+
* {{ic|&}}: &amp;amp;
 +
* {{ic|<}}: &amp;lt;
 +
* {{ic|>}}: &amp;gt;
  
=== Edit or create new themes ===
+
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].
 +
  <keybind key="W-l">
 +
    <action name="Execute">
 +
      <command>sh -c 'slock &amp;amp; (sleep .5 &amp;amp;&amp;amp; xset dpms force off)'</command>
 +
    </action>
 +
  </keybind>
  
{{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.}}
+
Sometimes one need to specify environment variable for application:
 +
  <keybind key="A-F7">
 +
    <action name="Execute">
 +
      <command>sh -c "LC_ALL=C obconf"</command>
 +
    </action>
 +
  </keybind>
  
The process of creating new or modifying existing themes is covered extensively at the official [http://openbox.org/wiki/Help:Themes openbox.org] website. A user-friendly GUI to do so - {{AUR|obtheme}} - is also available from the [[AUR]].
+
Another example will launch application preserving all stdout and stderr output to file:
 +
  <keybind key="A-f">
 +
    <action name="Execute">
 +
      <command>sh -c sh -c "exec gimp &amp;gt;/tmp/gimp.out 2&amp;gt;&amp;amp;1"</command>
 +
    </action>
 +
  </keybind>
  
== Compositing effects ==
+
Enable screenshot:
 +
  <keybind key="Print">
 +
    <action name="Execute">
 +
      <command>gnome-screenshot -c</command>
 +
    </action>
 +
  </keybind>
 +
  <keybind key="A-Print">
 +
    <action name="Execute">
 +
      <command>gnome-screenshot -c -w</command>
 +
    </action>
 +
  </keybind>
 +
  <keybind key="W-Print">
 +
    <action name="Execute">
 +
      <command>gnome-screenshot -i</command>
 +
    </action>
 +
  </keybind>
  
Openbox does not natively provide support for compositing, and it will therefore be necessary to install a compositor for this purpose. The use of compositing enables various desktop visual effects, including transparency, fading, and shadows. Although compositing is not a necessary component, it can help to provide a more pleasant-looking environment, and avoid common issues such as screen distortion when [[Openbox#Oblogout|oblogout]] is used, and visual glitches when terminal window transparency has been enabled. Three of the most common choices are:
+
=== Switch desktops using the mouse ===
  
* [[Compton]]: Powerful and reliable, with extensive options
+
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}}:
* [[Xcompmgr]]: Older and simpler version of compton
 
* [[Cairo Compmgr]]: Advanced compositing effects, plugin support, and a user-friendly GUI. Also more buggy and far heavier use of system resources.
 
  
== Mouse cursor and application icon themes ==
+
xdotool behave_screen_edge --delay 500 left set_desktop --relative -- -1 &
 +
xdotool behave_screen_edge --delay 500 right set_desktop --relative -- +1 &
  
Any mouse cursor and/or application icon theme may be used with Openbox. Numerous themes are available from both the [[official repositories]] and the [[AUR]].
+
=== Set default applications / file associations ===
  
=== xcursor themes (mouse) ===
+
See the [[Default applications]] article.
  
{{Tip|Review the [[Xcursor]] article for an in-depth explanation.}}
+
=== Ad-hoc window transparency ===
  
Standard xcursor theme packages available from the official repositories include {{Pkg|xcursor-themes}}, {{Pkg|xcursor-bluecurve}}, {{Pkg|xcursor-vanilla-dmz}}, and {{Pkg|xcursor-pinux}}. To search the official repositories for all available xcursor themes, enter the following command:
+
{{Warning|This may not work where other actions are defined within the action group.}}
 +
The program {{Pkg|transset-df}} can enable window transparency on-the-fly.
  
$ pacman -Ss xcursor
+
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:
  
Installed x-cursor themes may then be set though using the {{Pkg|obconf}} and {{Pkg|lxappearance-obconf}} GUI applications. It may then be necessary to either log out and back in again to implement the change, or to [[Openbox#Openbox_Reconfiguration|reconfigure Openbox]].
+
<context name="Titlebar">
 +
    ...
 +
    <mousebind button="Up" action="Click">
 +
        <action name= "Execute" >
 +
        <execute>transset-df -p .2 --inc  </execute>
 +
        </action>
 +
    </mousebind>
 +
    <mousebind button="Down" action="Click">
 +
        <action name= "Execute" >
 +
        <execute>transset-df -p .2 --dec </execute>
 +
        </action>
 +
    </mousebind>
 +
    ...
 +
</context>
  
=== Application icon themes ===
+
=== Using obxprop for faster configuration ===
  
Standard xcursor theme packages available from the official repositories include the {{Pkg|gnome-icon-theme}} and {{Pkg|lxde-icon-theme}}. A nice icon theme currently available from the AUR is {{AUR|numix-icon-theme-git}}. To search the official repositories for all available icon themes, enter the following command:
+
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.
  
$ pacman -Ss icon-theme
+
=== Xprop values for applications ===
  
Again, installed icon themes may then be set though using the {{Pkg|obconf}} and {{Pkg|lxappearance-obconf}} GUI applications. It may then be necessary to either log out and back in again to implement the change, or to [[Openbox#Openbox_Reconfiguration|reconfigure Openbox]].
+
{{Pkg|xorg-xprop}} 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:
  
== Desktop icons and wallpapers ==
+
alias xp='xprop | grep "WM_WINDOW_ROLE\|WM_CLASS" && echo "WM_CLASS(STRING) = \"NAME\", \"CLASS\""'
  
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.
+
To use Xorg-XProp, run using the alias given {{ic|xp}}, and click on the active program desired to define with per-application settings. 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:
  
=== Desktop management using file managers ===
+
WM_WINDOW_ROLE(STRING) = "roster"
 +
WM_CLASS(STRING) = "gajim.py", "Gajim.py"
 +
WM_CLASS(STRING) = "NAME", "CLASS"
  
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.
+
=== Switching between keyboard layouts ===
  
* [[PCManFM]]: See the [[PCManFM#Desktop_management|PCManFM desktop management]] article.
+
See the article section [[Keyboard configuration in Xorg#Switching between keyboard layouts|switching between keyboard layouts]] for instructions.
* [[SpaceFM]]: See the [[SpaceFM#Desktop_management|SpaceFM desktop management]] article.
 
  
=== Wallpaper / background programs ===
+
=== Set grid layout for virtual desktops ===
  
{{Tip|The wallpaper programs listed here will have many more options than shown in this brief overview, including the ability to use solid colours for backgrounds. Review their documentation and man pages for more information.}}
+
Install {{AUR|obsetlayout}}. To set a 2x2 grid for example:
  
There are numerous packages available to set desktop backgrounds in Openbox, each of which will need to be autostarted in the {{ic|~/.config/openbox/autostart}} file. A few of the most well known have been listed.
+
obsetlayout 0 2 2 0
  
==== nitrogen ====
+
Run it without arguments to know what the arguments mean.
  
{{Tip|If nitrogen does not show in the desktop menu, then it can be manually added.}}
+
=== Enable Hot Corners ===
  
[[nitrogen]] is a user-friendly choice, as it also provides a GUI window to browse and set installed images. To access the GUI, enter the following command in a terminal:
+
[https://github.com/mlde/lead lead] provides hot corners for openbox and other lightweight window managers. Start the application with a entry in the autostart-file:
  
  $ nitrogen
+
  mlde.lead &
  
To use nitrogen as the background provider, add the following command to the {{ic|~/.config/openbox/autostart}} file so that it will restore the last set wallpaper:
+
Commands can be edited in the configuration file {{ic|~/.config/mlde/lead.conf}}:
  
  nitrogen --restore &
+
  [eDP1]
 +
bottom=
 +
bottomLeft=chromium
 +
bottomRight=thunar
 +
left=
 +
right=
 +
top=
 +
topLeft=mlde.californium toggle
 +
topRight=skippy-xd
  
==== feh ====
+
=== Window snapping ===
  
[[Feh]] is a popular image viewer that may also be used to set wallpapers. In this instance, it will be necessary to add the full directory path and name of the image to be used as the wallpaper. To use Feh as the background provider, add the following command to the {{ic|~/.config/openbox/autostart}} file:
+
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|keybinds]] on focused windows.  
  
feh --bg-scale ''/path/to/image.file'' &
+
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:
  
==== hsetroot ====
+
<keybind key="W-Left">
 +
    <action name="UnmaximizeFull"/>
 +
    <action name="MaximizeVert"/>
 +
    <action name="MoveResizeTo">
 +
        <width>50%</width>
 +
    </action>
 +
    <action name="MoveToEdge"><direction>west</direction></action>
 +
</keybind>
 +
<keybind key="W-Right">
 +
    <action name="UnmaximizeFull"/>
 +
    <action name="MaximizeVert"/>
 +
    <action name="MoveResizeTo">
 +
        <width>50%</width>
 +
    </action>
 +
    <action name="MoveToEdge"><direction>east</direction></action>
 +
</keybind>
  
{{Pkg|hsetroot}} is a command-line tool specifically designed to set wallpapers. As with Feh, it will be necessary to add the full directory path and name of the image to be used as the wallpaper. To use HSetRoot as the background provider, add the following command to the {{ic|~/.config/openbox/autostart}} file:
+
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:
  
  hsetroot -fill ''/path/to/image.file'' &
+
  <keybind key="W-Down">
 +
    <action name="Unmaximize"/>
 +
</keybind>
 +
<keybind key="W-Up">
 +
    <action name="Maximize"/>
 +
</keybind>
  
==== xsetroot ====
+
This [http://ubuntuforums.org/showthread.php?t=1796793 Ubuntu forum thread] provides more information. Applications such as {{AUR|opensnap}} are also available to automatically simulate window snapping behaviour without the use of keybinds.
 +
Another option is to use {{AUR|bunsen-utilities-git}} which provides {{ic|bl-aerosnap --left}} and {{ic|bl-aerosnap --right}} commands which will snap active window on left or right edge respectively if it's not snapped and restore it to original size and position otherwise. Just bind these commands to the key combination of your choosing.
  
{{ic|xsetroot}} is installed as part of the [[Xorg]] X-Windows system, and may be used to set simple background colours. For example, to use XSetRoot to set a black background, the following would be added to the {{ic|~/.config/openbox/autostart}} file:
+
=== Smooth display manager transition ===
  
xsetroot -solid "#000000" &
+
{{Note|This has been confirmed to work with [[LightDM]].}}
  
=== Icon programs ===
+
Users of display managers might experience a flickering during the transition between the display manager and the Openbox desktop. The flickering comes from Openbox setting the root window's color during startup. Therefore there's a brief moment when the display flashes in a grey color, between the display manager's background and the desktop's wallpaper.
  
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.
+
Setting the root window's background color can be disabled by editing the Openbox startup script found in {{ic|/usr/lib/openbox/openbox-autostart}}. Simply comment out (or delete) the block starting with {{ic|# Set a background color}}.
  
==== idesk ====
+
{{Note|Users who don't specifically set their wallpaper will "inherit" the display manager's background automatically if they disable the root window color adjustment.}}
  
[[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:
+
=== Window Decorations ===
  
idesk &
+
To remove window decorations for all or particular applications, use the ''<decor>'' option in the ''<applications>'' section of ''rc.xml'' (user: ''~/.config/openbox/'' or system: ''/etc/xdg/openbox/'').<br>
 +
Example for Firefox, including variants like Firefox-Beta and Firefox-Nightly:
 +
  <application class="Firefox*">
 +
    <decor>no</decor>
 +
  </application>
 +
One could also disable decorations for all applications (using class '''"*"'''), then enable them (using '''yes''') for individual ones. To apply the changes, restart your desktop session, and thus Openbox. Reference: [http://openbox.org/wiki/Help:FAQ#How_do_I_remove_the_decorations_from_all_my_windows.3F Openbox FAQ]
  
==== xfdesktop ====
+
== Troubleshooting ==
 
 
{{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.
 
 
 
As such, it will consequently be necessary to access it by other means, such as by [[Openbox#Desktop_Menu|creating a keybind]], and/or by - where permitted - re-configuring an installed panel to use the [[Openbox#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:
 
  
xfdesktop &
+
=== Firefox ===
  
=== conky reconfiguration ===
+
Mozilla based browsers may ignore application rules (e.g. {{ic|<desktop>}}) unless {{ic|1=class="Firefox"}} is used. See [[#Xprop values for applications]].
  
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:
+
=== Missing themes ===
  
own_window_type normal
+
If for any reason the newly extracted theme cannot be selected, open the theme directory to first ensure that it is compatible with Openbox - there should be an {{ic|openbox-3}} directory and a {{ic|themerc}} file within it. 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}}.
  
== File managers ==
+
A theme may also be not accessible due to wrong permissions. See [[File permissions and attributes]] for more.
  
Multiple [[List of applications#File managers|file managers]] may be used with Openbox, including [[PCManFM]], [[SpaceFM]], [[Thunar]], {{Pkg|xfe}}, and {{Pkg|qtfm}}. Thunar is the native file manager for [[Xfce]], and if installing be aware that some Xfce-related dependencies will also be installed, including {{Pkg|exo}} (set default applications) and '''xfce4-about''' (provide information about the Xfce deskop environment). The menu entries for these may consequently have to be hidden.
+
=== Stop continuous desktop switching ===
 
 
A file manager alone will not provide the same features and functionality as provided by default in full desktop environments like [[Xfce]] and [[KDE]]. For example, it may not be initially possible to view or access other partitions or access removable media. See [[File manager functionality]] for further information.
 
 
 
== oblogout ==
 
 
 
See the [[Oblogout]] article for an overview on how to use this useful, graphical logout script.
 
 
 
== Openbox for multihead users ==
 
 
 
While Openbox provides better than average multihead support on its own, the {{AUR|openbox-multihead-git}} package from the [[AUR]] 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.
 
 
 
Openbox Multihead will function like normal Openbox when only a single head is available.
 
 
 
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, {{AUR|pager-multihead-git}} can be found in the [[AUR]] and is compatible with Openbox Multihead. [http://imgur.com/a/cnZeq#y04nk Screenshots].
 
 
 
Finally, a new version of [[PyTyle]] that will work with Openbox Multihead can also be found in the [[AUR]]: {{AUR|pytyle3-git}}.
 
 
 
Both ''pytyle3'' and ''pager-multihead-git'' will work without Openbox Multihead if only one monitor is active.
 
 
 
== Tips and tricks ==
 
 
 
=== Packages for beginners ===
 
 
 
{{Tip|See the [[List of applications]] article for many more possibilities.}}
 
 
 
The packages listed below have been listed to aid newer users:
 
 
 
* Display Manager: [[LXDM]] or [[LightDM]]
 
* Audio: [[ALSA]]
 
* Volume: {{Pkg|volumeicon}} or {{AUR|pnmixer}} with {{Pkg|gnome-alsamixer}}
 
* Network: [[Network manager]] with {{Pkg|network-manager-applet}}
 
* Panel: [[Tint2]] or [[Tint2#Application_Launchers_in_tint2-svn_.28AUR.29|Tint2-svn]]
 
* Background: [[Nitrogen]] or [[Feh]]
 
* Menu: [[Openbox#obmenu-generator|OBMenu-Generator]]
 
* Compositor: [[Compton]]
 
* Desktp Notifications: {{Pkg|xfce4-notifyd}}
 
* Logout script: [[Oblogout]]
 
* File Manager: [[PCManFM]], [[SpaceFM]], or [[Thunar]]
 
* Clipboard Manager: {{Pkg|parcellite}}
 
* Configuration GUIs: {{Pkg|obconf}}, {{Pkg|lxappearance-obconf}}, {{Pkg|lxrandr}}, {{Pkg|lxinput}}, {{AUR|tintwizard}} or {{AUR|tintwizard-svn}}
 
 
 
=== Switch desktops using the mouse ===
 
 
 
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}}:
 
 
 
xdotool behave_screen_edge --delay 500 left set_desktop --relative -- -1 &
 
xdotool behave_screen_edge --delay 500 right set_desktop --relative -- +1 &
 
 
 
=== Set default applications / file associations ===
 
 
 
See the [[Default applications]] article.
 
 
 
=== Stop continous mouse wheel desktop switching ===
 
  
 
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.
 
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.
Line 832: Line 631:
 
       </mousebind>
 
       </mousebind>
 
     </context>
 
     </context>
 
=== Terminal content copy and paste ===
 
 
Within a terminal, either:
 
 
* {{ic|Ctrl+Ins}} will copy and {{ic|Shift+Ins}} will paste.
 
* {{ic|Ctrl+Shift+c}} will copy and '''mouse middle-click''' will paste.
 
 
=== Ad-hoc window transparency ===
 
 
{{Warning|This may not work where other actions are defined within the action group.}}
 
The program {{Pkg|transset-df}} is available in the official repositories, and can enable window transparency on-the-fly.
 
 
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:
 
 
<context name="Titlebar">
 
    ...
 
    <mousebind button="Up" action="Click">
 
        <action name= "Execute" >
 
        <execute>transset-df -p .2 --inc  </execute>
 
        </action>
 
    </mousebind>
 
    <mousebind button="Down" action="Click">
 
        <action name= "Execute" >
 
        <execute>transset-df -p .2 --dec </execute>
 
        </action>
 
    </mousebind>
 
    ...
 
</context>
 
 
=== Using obxprop for faster configuration ===
 
 
{{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. Doing so for multiple applications and its windows can be very inefficient however. The following script {{ic|obxprop2obrc}} makes it much easier to configure even a large number of applications.
 
 
{{bc|<nowiki>
 
#!/bin/bash
 
##Script: obxprop-to-openbox-rc.sh
 
##Recommended executable name: obxprop2obrc
 
 
while [ $# -ne 0 ]; do
 
case $1 in
 
    -f*)
 
        shift;
 
        FILE="$1";
 
shift;
 
    ;;
 
    -t*)
 
        shift;
 
        TIME="$1";
 
shift;
 
    ;;
 
    *)
 
        echo Usage: $0 [-f FILE_TEMPLATE] [-t WAIT_TO_KILL_TIME]
 
        exit 1;
 
    ;;
 
esac
 
done
 
 
if [ $TIME ]; then
 
    OBXPROPS=( $(obxprop | cat & (sleep $TIME && pkill -13 cat) | awk -F \" '/_OB_APP/{ print "\x22"$2"\x22" }' ) );
 
else
 
    OBXPROPS=( $(obxprop | awk -F \" '/_OB_APP/{ print "\x22"$2"\x22" }' ) );
 
fi
 
OBPROPS=(TYPE TITLE GROUP_CLASS GROUP_NAME CLASS NAME ROLE);
 
j=0;
 
for i in $( seq 2 2 14 ); do
 
    OBPROP="$( echo ${OBXPROPS[@]} | awk -F \" '{ print $'$i'}' )";
 
    if [[ -z $OBPROP ]]; then
 
        declare ${OBPROPS[$j]}='"*"';
 
    else
 
        declare ${OBPROPS[$j]}="\"$OBPROP\"";
 
    fi
 
    j=$(($j+1));
 
done;
 
 
echo "    <application type="$TYPE" title="$TITLE" class="$CLASS" name="$NAME" role="$ROLE">"
 
if [ -f "$FILE"  ]; then cat "$FILE" && exit; fi
 
cat << EOF
 
      <desktop>1</desktop>
 
      <desktop>all</desktop>
 
      <decor>yes</decor>
 
      <decor>no</decor>
 
      <focus>yes</focus>
 
      <focus>no</focus>
 
      <fullscreen>yes</fullscreen>
 
      <fullscreen>no</fullscreen>
 
      <iconic>yes</iconic>
 
      <iconic>no</iconic>
 
      <maximized>yes</maximized>
 
      <maximized>no</maximized>
 
      <maximized>both</maximized>
 
      <maximized>horizontal</maximized>
 
      <maximized>vertical</maximized>
 
      <monitor>0</monitor>
 
      <monitor>1</monitor>
 
      <position force="no">
 
      <position force="yes">
 
        <width>40%</width>
 
        <height>30%</height>
 
        <x>-1</x>
 
        <y>-1</y>
 
        <x>center</x>
 
        <y>center</y>
 
      </position>
 
      <layer>above</layer>
 
      <layer>normal</layer>
 
      <layer>below</layer>
 
      <shade>yes</shade>
 
      <shade>no</shade>
 
      <skip_pager>yes</skip_pager>
 
      <skip_pager>no</skip_pager>
 
      <skip_taskbar>yes</skip_taskbar>
 
      <skip_taskbar>no</skip_taskbar>
 
    </application>
 
EOF
 
</nowiki>}}
 
 
If no further options are used default configuration, that can be edited by deleting unnecessary lines, is printed out. This script can use templates with default values when using {{ic|-f}} switch:
 
{{hc|
 
$ obxprop2obrc -f templates-rc-inkscape-dialogs.sc > part-rc-applications-inkscape.xml
 
$ cat part-rc-applications-inkscape.xml|<nowiki>
 
<application type="normal" title="Align and Distribute (Shift+Ctrl+A)" class="Inkscape" name="inkscape" role="*">
 
  <desktop>3</desktop>
 
  <decor>yes</decor>
 
  <maximized>no</maximized>
 
  <position force="yes">
 
    <width>20%</width>
 
    <height>30%</height>
 
    <x>-1</x>
 
    <y>-1</y>
 
  </position>
 
  <layer>normal</layer>
 
  <shade>yes</shade>
 
</application>
 
</nowiki>}}
 
 
It also has a time switch {{ic|-t}} which kills obxprop and thus can reduce time significantly in certain situations, although it may not work perfectly.
 
 
=== Xprop values for applications ===
 
 
{{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:
 
dy:
 
 
alias xp='xprop | grep "WM_WINDOW_ROLE\|WM_CLASS" && echo "WM_CLASS(STRING) = \"NAME\", \"CLASS\""'
 
 
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:
 
 
WM_WINDOW_ROLE(STRING) = "roster"
 
WM_CLASS(STRING) = "gajim.py", "Gajim.py"
 
WM_CLASS(STRING) = "NAME", "CLASS"
 
 
==== Firefox ====
 
 
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}}.
 
 
=== Switching between keyboard layouts ===
 
 
See the article section [[Keyboard configuration in Xorg#Switching between keyboard layouts|switching between keyboard layouts]] for instructions.
 
 
== Troubleshooting ==
 
  
 
=== Windows load behind the active window ===
 
=== Windows load behind the active window ===
Line 1,008: Line 647:
  
 
* [http://openbox.org/ Openbox Website] - Official website
 
* [http://openbox.org/ Openbox Website] - Official website
* [http://planetob.openmonkey.com/ Planet Openbox] - Openbox news portal
 
 
* [http://www.box-look.org/ Box-Look.org] - A good resource for themes and related artwork
 
* [http://www.box-look.org/ Box-Look.org] - A good resource for themes and related artwork
 
* [https://bbs.archlinux.org/viewtopic.php?id=93126 Openbox Hacks and Configs Thread] @ Arch Linux Forums
 
* [https://bbs.archlinux.org/viewtopic.php?id=93126 Openbox Hacks and Configs Thread] @ Arch Linux Forums
 
* [https://bbs.archlinux.org/viewtopic.php?id=45692 Openbox Screenshots Thread] @ Arch Linux Forums
 
* [https://bbs.archlinux.org/viewtopic.php?id=45692 Openbox Screenshots Thread] @ Arch Linux Forums
 
* [http://urukrama.wordpress.com/openbox-guide/ An Openbox guide]
 
* [http://urukrama.wordpress.com/openbox-guide/ An Openbox guide]

Latest revision as of 16:15, 15 August 2019

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.

Installation

Install the openbox package.

Starting

Standalone

Run openbox or openbox-session with xinit. Note that only openbox-session provides #Autostart.

Note: After executing openbox-session, there is only a blank grey screen. Try to move your mouse and right click to get an openbox menu to make sure that it is actually working.

Other desktop environments

Note:

See Desktop environment#Use a different window manager.

Configuration

Note: Local configuration files will always override global equivalents.

Four key files form the basis of the openbox configuration, each serving a unique role. They are: rc.xml, menu.xml, autostart, and 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 /etc/xdg/openbox profile (applicable to any and all users) as a template:

$ mkdir -p ~/.config/openbox
$ cp -a /etc/xdg/openbox/. ~/.config/openbox/

rc.xml

Tip: Custom keyboard shortcuts (keybindings) must be added to the <keyboard> section of this file, and underneath the <!-- Keybindings for running aplications --> heading.

~/.config/openbox/rc.xml is the main configuration file, responsible for determining the behaviour and settings of the overall session, including:

  • Keyboard shortcuts (e.g. starting applications; controlling the volume)
  • Theming
  • Desktop and Virtual desktop settings, and
  • Application Window settings

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.

Note: Per-application settings pertaining to fixed placement of applications per monitor will only work if the x & y position have also been defined.

menu.xml

~/.config/openbox/menu.xml defines the type and behaviour of the desktop menu, accessible 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.

The available options are discussed extensively below in the #Menus section.

Autostart

openbox-session provides two autostart mechanisms: XDG Autostart (which only works if python2-xdg is installed) and Openbox's own autostart mechanism.

Openbox's own autostart mechanism:

  • sources /etc/xdg/openbox/environment
  • sources ~/.config/openbox/environment
  • runs /etc/xdg/openbox/autostart
  • runs ~/.config/openbox/autostart

Issues regarding commands in ~/.config/openbox/autostart being executed out of order (or skipped altogether) are often resolved by the addition of small delays. For instance:

xset -b
(sleep 3s && nm-applet) &
(sleep 3s && conky) &

environment

~/.config/openbox/environment can be used to export and set relevant environmental variables such as to:

  • Define new pathways (e.g. execute commands that would otherwise require the entire pathway to be listed with them)
  • Change language settings, and
  • Define other variables to be used (e.g. the fix for GTK theming could be listed here)

Themes

Install obconf and/or lxappearance-obconf for a GUI to configure visual settings and theming.

A good selection of themes are available in the openbox-themesAUR package or the AUR. Some GTK#Themes come with an Openbox theme as well. Both Openbox-specific and Openbox-compatible themes will be installed to the /usr/share/themes directory and will also be immediately available for selection.

box-look.org is an excellent and well-established source of themes. deviantART.com is another excellent resource. Many more can be found online.

Edit or create

Tip: It's better to copy a theme to your home directory than to edit those found in /usr/share/themes/. This will retain the original should anything go wrong and ensure that your changes are not overwritten on update.

The process of creating new or modifying existing themes is covered extensively at the official openbox.org website. obthemeAUR is a user-friendly GUI for doing so.

GUI configuration

Several GUI applications are available to quickly and easily configure your Openbox desktop.

  • ObConf — A GTK2 based configuration tool for the Openbox window manager.
http://openbox.org/wiki/ObConf:About || obconf
  • 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 || lxappearance-obconf
  • LXInput — LXDE keyboard and mouse configuration
http://lxde.org || lxinput
  • LXRandR — LXDE monitor configuration.
http://wiki.lxde.org/en/LXRandR || lxrandr
  • obkey — Configure Openbox keyboard shortcuts
https://code.google.com/p/obkey/ || obkeyAUR
  • ob-autostart — A simple autostart application for Openbox.
http://pastebin.com/012YgXTk || ob-autostartAUR
  • obapps — Graphical tool for configuring application settings in Openbox.
https://sourceforge.net/projects/obapps/ || obappsAUR

Programs and applications relating to the configuration of Openbox's desktop menu are discussed in the Menus section.

Openbox reconfiguration

Tip: where not already present, it would be worthwhile adding this command to a menu and/or as a keybind for convenience.

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:

$ openbox --reconfigure

Where intending to add this command as a keybind to ~/.config/openbox/rc.xml, it will only be necessary to list the command as reconfigure. An example has been provided below, using the Super+F11 keybind:

<keybind key="W-F11">
  <action name="Reconfigure"/>
</keybind>

Keybinds

All keybinds must be added to the ~/.config/openbox/rc.xml file, and below the <!-- Keybindings for running aplications --> heading. Although a brief overview has been provided here, a more in-depth explanation of keybindings can be found at openbox.org.

Keybinds can be added to the configuration file using the following syntax:

<keybind key="my-key-combination">
  <action name="my-action">
    ...
  </action>
</keybind>

The action name for running an external command is Execute. Use the following syntax to define an external command to execute:

<action name="Execute">
  <command>my-command</command>
</action>

See the Openbox wiki for a list of all available actions.

Tip: The obkeyAUR utility provides a graphical interface for configuring key bindings. Before using obkey, you should use obconf to create ~/.config/openbox/rc.xml.

While the use of standard alpha-numeric keys for keybindings is self-explanatory, special names are assigned to other types of keys, such as modifiers, multimedia and navigation.

Modifiers

Modifier keys play an important role in keybindings (e.g. holding down the shift or CTRL / control key in combination with another key to undertake an action). Using modifiers 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 modifier with another key is:

"<modifier>-<key>"

The modifier codes are as follows:

  • S: Shift
  • C: Control / CTRL
  • A: Alt
  • W: Super / Windows
  • M: Meta
  • H: Hyper (If it is bound to something)

Multimedia keys

Where available, it is possible to set the appropriate 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 function keys, and are identified by their appropriate symbols. See Extra keyboard keys for details.

The volume and brightness multimedia codes are as follows (note that commands will still have to be assigned to them to actually function):

  • XF86AudioRaiseVolume: Increase volume
  • XF86AudioLowerVolume: Decrease volume
  • XF86AudioMute: Mute / unmute volume
  • XF86MonBrightnessUp: Increase screen brightness
  • XF86MonBrightnessDown: Decrease screen brightness

For a full list of XF86 multimedia keys, see the LinuxQuestions wiki.

Volume control

What commands should be used for controlling the volume will depend on whether ALSA, PulseAudio, or OSS is used for sound.

Navigation keys

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:

  • Up: Up
  • Down: Down
  • Left: Left
  • Right: Right

Menus

It is possible to employ three types of menu in Openbox: static, pipes (dynamic), and generators (static or dynamic). They may also be used alone or in any combination.

Static

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.

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 synapse or xfce4-appfinder applications).

The ~/.config/openbox/menu.xml file will be the sole source of static desktop menu content.

menumaker

menumaker automatically generates 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.

Once installed and executed, it will automatically generate a new ~/.config/openbox/menu.xml file. To avoid overwriting an existing file, enter:

$ mmaker -v OpenBox3

Otherwise, to overwrite an existing file, add the force argument (f):

$ mmaker -vf OpenBox3

Once a new ~/.config/openbox/menu.xml file has been generated it may then be manually edited, or configured using a GUI menu editor, such as obmenuAUR.

obmenu

Warning: 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.

obmenuAUR is a "user-friendly" GUI application to edit ~/.config/openbox/menu.xml, without the need to code in xml.

xdg-menu

archlinux-xdg-menu will automatically generate a menu based on xdg files contained within the /etc/xdg/ directory for numerous Window Managers, including Openbox. Review the Xdg-menu#OpenBox article for further information.

logout menu options

Tip: The commands provided can also be attached to keybinds.

The ~/.config/openbox/menu.xml file can be edited in order to provide a sub-menu with the same options as provided by oblogout. The sample script below will provide all of these options, with the exception of the ability to lock the screen:

<menu id="exit-menu" label="Exit">
	<item label="Log Out">
		<action name="Execute">
			<command>openbox --exit</command>
		</action>
	</item>
	<item label="Shutdown">
		<action name="Execute">
			<command>systemctl poweroff</command>
		</action>
	</item>
	<item label="Restart">
		<action name="Execute">
		        <command>systemctl reboot</command>
		</action>
	</item>
	<item label="Suspend">
		<action name="Execute">
		        <command>systemctl suspend</command>
		</action>
	</item>
	<item label="Hibernate">
		<action name="Execute">
		        <command>systemctl hibernate</command>
		</action>
	</item>
</menu>

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):

<menu id="exit-menu"/>

Pipes

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.

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, ~/.config/openbox/menu.xml may and commonly will contain several pipe menus.

Examples

Openbox.org also provides a further list of pipe menus.

Generators

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.

A menu generator will have to be executed from the ~/.config/openbox/menu.xml file.

obmenu-generator

Tip: icons can still be disabled in obmenu-generatorAUR, even where enabled in ~/.config/openbox/rc.xml.

obmenu-generatorAUR 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 official homepage provides further information and screenshots.

Below is an example of how obmenu-generator would be dynamically executed without icons in ~/.config/openbox/menu.xml:

<?xml version="1.0" encoding="utf-8"?>
<openbox_menu>
    <menu id="root-menu" label="OpenBox 3" execute="/usr/bin/obmenu-generator">
    </menu>
</openbox_menu>

To automatically iconify entries, the -i option would be added:

<menu id="root-menu" label="OpenBox 3" execute="/usr/bin/obmenu-generator -i">

openbox-menu

Tip: If this menu produces an error, it may be solved by enabling icons in ~/.config/openbox/rc.xml.

openbox-menuAUR uses the LXDE menu-cache to create dynamic menus. The official homepage provides further information and screenshots.

Menu icons

To show icons next to menu entries, it will be necessary to ensure they are enabled in the <menu> section of the ~/.config/openbox/rc.xml file:

<applicationIcons>yes</applicationIcons>

Where using a static menu, it will then be necessary to edit the ~/.config/openbox/menu.xml file to provide both the icon = 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:

<menu id="apps-menu" label="[label name]" icon="[pathway to icon]/[icon name]">

Desktop menu as a panel menu

Tip: XDoTool can simulate any keybind for any action, and as such, it may therefore be used for many other purposes...

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:

  • Replace an existing panel menu
  • Implement a panel menu where otherwise not provided or possible (e.g. for Tint2)
  • Compensate where losing access to the desktop menu due to the use of an application like xfdesktop to manage the desktop.

Once XDoTool has been installed - if not already present - it will be necessary to create a keybind to access the root menu in ~/.config/openbox/rc.xml, and again below the <!-- Keybindings for running aplications --> heading. For example, the following code will bring up the menu by pressing CTRL + m:

<keybind key="C-m">
    <action name="ShowMenu">
       <menu>root-menu</menu>
    </action>
</keybind>

Openbox must then be reconfigured. In this instance, XDoTool will be used to simulate the CTRL + m keypress to access the desktop menu with the following command (note the use of + in place of -):

xdotool key control+m

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 obpanelmenu.sh will be created in the ~/.config folder:

$ text editor ~/.config/obpanelmenu.sh

Once the empty file has been opened, the appropriate XDoTool command must be added to the empty file (i.e. to simulate the CTRL + m keypress for this example):

xdotool key control+m

After the file has been saved and closed, it may then be made into an executable script with the following command:

$ chmod +x ~/.config/obpanelmenu.sh

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.

XDG compliant menu

A xdg compliant menu is based on the freedesktop.org standard. The menu is defined in menu-files which reside in /etc/xdg/menus. New applications will occur automatically in the menu.

Examples

  • californium: xdg menu based on the LXQt main menu and easily themable

Tips and tricks

Cursor and icon themes

See Cursor themes and Icons for details.

Desktop icons and wallpapers

Openbox does not natively support the use of desktop icons or wallpapers.

See PCManFM, SpaceFM and Idesk.

Note: You may have to edit ~/.conkyrc and set own_window_type to normal.

See List of applications#Wallpaper setters.

Compositing effects

Openbox does not provide native support for compositing, and thus requires an external compositor for this purpose.

Although compositing is not a necessary component, it may specifically avoid issues such as screen distortion with oblogout, and visual glitches with terminal window transparency. See Xorg#Composite for common choices.

oblogout

See the Oblogout article for an overview on how to use this useful, graphical logout script.

Openbox for multihead users

While Openbox provides better than average multihead support on its own, openbox-multihead-gitAUR 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 Xmonad web site. Also, please see README.MULTIHEAD for a more comprehensive description of the new features and configuration options found in Openbox Multihead.

Openbox Multihead will function like normal Openbox when only a single head is available.

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 pager-multihead-gitAUR[broken link: archived in aur-mirror] alongside Openbox Multihead. It will work without Openbox Multihead if only one monitor is active.

Launch a complex command with hotkey

If you need to execute a complex command, use shell functionality.

Special character replacement are as follows:

  • &: &amp;
  • <: &lt;
  • >: &gt;

This example will turn off display immediately and lock screen with slock. It was taken from this thread.

 <keybind key="W-l">
   <action name="Execute">
     <command>sh -c 'slock &amp; (sleep .5 &amp;&amp; xset dpms force off)'</command>
   </action>
 </keybind>

Sometimes one need to specify environment variable for application:

 <keybind key="A-F7">
   <action name="Execute">
     <command>sh -c "LC_ALL=C obconf"</command>
   </action>
 </keybind>

Another example will launch application preserving all stdout and stderr output to file:

 <keybind key="A-f">
   <action name="Execute">
     <command>sh -c sh -c "exec gimp &gt;/tmp/gimp.out 2&gt;&amp;1"</command>
   </action>
 </keybind>

Enable screenshot:

 <keybind key="Print">
   <action name="Execute">
     <command>gnome-screenshot -c</command>
   </action>
 </keybind>
 <keybind key="A-Print">
   <action name="Execute">
     <command>gnome-screenshot -c -w</command>
   </action>
 </keybind>
 <keybind key="W-Print">
   <action name="Execute">
     <command>gnome-screenshot -i</command>
   </action>
 </keybind>

Switch desktops using the mouse

It is possible to switch desktop by moving the mouse cursor to the edges of the screen. First install xdotool and add the following two lines to your ~/.xinitrc:

xdotool behave_screen_edge --delay 500 left set_desktop --relative -- -1 &
xdotool behave_screen_edge --delay 500 right set_desktop --relative -- +1 &

Set default applications / file associations

See the Default applications article.

Ad-hoc window transparency

Warning: This may not work where other actions are defined within the action group.

The program transset-df can enable window transparency on-the-fly.

For example, using the following code in the <mouse> section of the ~/.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:

<context name="Titlebar">
    ...
    <mousebind button="Up" action="Click">
        <action name= "Execute" >
        <execute>transset-df -p .2 --inc  </execute>
        </action>
    </mousebind>
    <mousebind button="Down" action="Click">
        <action name= "Execute" >
        <execute>transset-df -p .2 --dec </execute>
        </action>
    </mousebind>
    ...
</context>

Using obxprop for faster configuration

The openbox package provides a obxprop binary that can parse relevant values for applications settings in rc.xml. Officially obxprop | grep "^_OB_APP" is recommended for this task. Start the process by running the command shown, then click a window to see its properties in the terminal.

Xprop values for applications

xorg-xprop can be used to relay property values for selected applications. Where frequently using per-application settings, the following Bash Alias may be useful:

alias xp='xprop | grep "WM_WINDOW_ROLE\|WM_CLASS" && echo "WM_CLASS(STRING) = \"NAME\", \"CLASS\""'

To use Xorg-XProp, run using the alias given xp, and click on the active program desired to define with per-application settings. The results displayed will only be the information that Openbox itself requires, namely the WM_WINDOW_ROLE and WM_CLASS (name and class) values:

WM_WINDOW_ROLE(STRING) = "roster"
WM_CLASS(STRING) = "gajim.py", "Gajim.py"
WM_CLASS(STRING) = "NAME", "CLASS"

Switching between keyboard layouts

See the article section switching between keyboard layouts for instructions.

Set grid layout for virtual desktops

Install obsetlayoutAUR. To set a 2x2 grid for example:

obsetlayout 0 2 2 0

Run it without arguments to know what the arguments mean.

Enable Hot Corners

lead provides hot corners for openbox and other lightweight window managers. Start the application with a entry in the autostart-file:

mlde.lead &

Commands can be edited in the configuration file ~/.config/mlde/lead.conf:

[eDP1]
bottom=
bottomLeft=chromium
bottomRight=thunar
left=
right=
top=
topLeft=mlde.californium toggle
topRight=skippy-xd

Window snapping

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.

As illustrated in the example below, percentages must be used to determine window sizes (see openbox.org for further information). In this instance, The super key is used in conjunction with the navigation keys:

<keybind key="W-Left">
    <action name="UnmaximizeFull"/>
    <action name="MaximizeVert"/>
    <action name="MoveResizeTo">
        <width>50%</width>
    </action>
    <action name="MoveToEdge"><direction>west</direction></action>
</keybind>
<keybind key="W-Right">
    <action name="UnmaximizeFull"/>
    <action name="MaximizeVert"/>
    <action name="MoveResizeTo">
        <width>50%</width>
    </action>
    <action name="MoveToEdge"><direction>east</direction></action>
</keybind>

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 down and up keys - to do so. This will also make pulling 'snapped' windows from screen edges faster as well:

<keybind key="W-Down">
   <action name="Unmaximize"/>
</keybind>
<keybind key="W-Up">
   <action name="Maximize"/>
</keybind>

This Ubuntu forum thread provides more information. Applications such as opensnapAUR are also available to automatically simulate window snapping behaviour without the use of keybinds. Another option is to use bunsen-utilities-gitAUR which provides bl-aerosnap --left and bl-aerosnap --right commands which will snap active window on left or right edge respectively if it's not snapped and restore it to original size and position otherwise. Just bind these commands to the key combination of your choosing.

Smooth display manager transition

Note: This has been confirmed to work with LightDM.

Users of display managers might experience a flickering during the transition between the display manager and the Openbox desktop. The flickering comes from Openbox setting the root window's color during startup. Therefore there's a brief moment when the display flashes in a grey color, between the display manager's background and the desktop's wallpaper.

Setting the root window's background color can be disabled by editing the Openbox startup script found in /usr/lib/openbox/openbox-autostart. Simply comment out (or delete) the block starting with # Set a background color.

Note: Users who don't specifically set their wallpaper will "inherit" the display manager's background automatically if they disable the root window color adjustment.

Window Decorations

To remove window decorations for all or particular applications, use the <decor> option in the <applications> section of rc.xml (user: ~/.config/openbox/ or system: /etc/xdg/openbox/).
Example for Firefox, including variants like Firefox-Beta and Firefox-Nightly:

 <application class="Firefox*">
   <decor>no</decor>
 </application>

One could also disable decorations for all applications (using class "*"), then enable them (using yes) for individual ones. To apply the changes, restart your desktop session, and thus Openbox. Reference: Openbox FAQ

Troubleshooting

Firefox

Mozilla based browsers may ignore application rules (e.g. <desktop>) unless class="Firefox" is used. See #Xprop values for applications.

Missing themes

If for any reason the newly extracted theme cannot be selected, open the theme directory to first ensure that it is compatible with Openbox - there should be an openbox-3 directory and a themerc file within it. An .obt (OpenBox Theme) file may also be present in some instances, which can then be manually loaded in obconf.

A theme may also be not accessible due to wrong permissions. See File permissions and attributes for more.

Stop continuous desktop switching

By default Openbox switches from the last desktop back to the first desktop on mouse wheel scroll. Use <wrap>no</wrap> in the mousebind section to disable this behaviour.

   <context name="Desktop">
     <mousebind button="Up" action="Click">
       <action name="GoToDesktop">
         <to>previous</to>
         <wrap>no</wrap>
       </action>
     </mousebind>
     <mousebind button="Down" action="Click">
       <action name="GoToDesktop">
         <to>next</to>
         <wrap>no</wrap>
       </action>
     </mousebind>
   </context>

Windows load behind the active window

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 ~/.config/openbox/rc.xml file, inbetween the <openbox_config> and </openbox_config> tags:

<applications>
  <application class="*">
    <focus>yes</focus>
  </application>
</applications>

See also