https://wiki.archlinux.org/api.php?action=feedcontributions&user=Crazy4108&feedformat=atomArchWiki - User contributions [en]2024-03-28T12:40:59ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Configure_virtual_console_colors&diff=218424Configure virtual console colors2012-08-17T13:27:37Z<p>Crazy4108: /* Virtual Console Login Screen */</p>
<hr />
<div>[[Category:Eye candy]]<br />
The colors in the Linux virtual console running on the framebuffer can be changed. This is done by writing the escape code {{ic|\\e]PXRRGGBB}} where {{ic|X}} is the hexadecimal index of the color from 0-F, and {{ic|RRGGBB}} is a traditional hexadecimal RGB code.<br />
<br />
==Reusing ~/.Xdefaults settings==<br />
To reuse the color configuration from ~/.Xdefaults, add the following snippet to the shell init script ({{ic|.bashrc}}/{{ic|.zshrc}}/...).<br />
<br />
if [ "$TERM" = "linux" ]; then<br />
_SEDCMD='s/.*\*color\([0-9]\{1,\}\).*#\([0-9a-fA-F]\{6\}\).*/\1 \2/p'<br />
for i in $(sed -n "$_SEDCMD" $HOME/.Xdefaults | \<br />
awk '$1 < 16 {printf "\\e]P%X%s", $1, $2}'); do<br />
echo -en "$i"<br />
done<br />
clear<br />
fi<br />
<br />
==Virtual Console Login Screen==<br />
Changing the default Virtual Console Login screen.<br />
Take a backup of your original {{ic|/etc/issue}} like {{ic|mv /etc/issue /etc/issue.bak}}.<br />
Make a new file called {{ic|issue}} in your {{ic|/etc/}} folder and input the following below.<br />
<br />
echo -e '\e[H\e[2J' > issue<br />
echo -e ' \e[1;30m| \e[34m\\s \\r' >> issue<br />
echo -e ' \e[36;1m/\\\\ \e[37m|| \e[36m| | \e[30m|' >> issue<br />
echo -e ' \e[36m/ \\\\ \e[37m|| \e[36m| _ \e[30m| \e[32m\\t' >> issue<br />
echo -e ' \e[1;36m/ \e[0;36m.. \e[1m\\\\ \e[37m//==\\\\\\\\ ||/= /==\\\\ ||/=\\\\ \e[36m| | |/ \\\\ | | \\\\ / \e[30m| \e[32m\\d' >> issue<br />
echo -e ' \e[0;36m/ . . \\\\ \e[37m|| || || | || || \e[36m| | | | | | X \e[1;30m|' >> issue<br />
echo -e ' \e[0;36m/ . . \\\\ \e[37m\\\\\\\\==/| || \\\\==/ || || \e[36m| | | | \\\\_/| / \\\\ \e[1;30m| \e[31m\\U' >> issue<br />
echo -e ' \e[0;36m/ .. .. \\\\ \e[0;37mA simple, lightweight linux distribution. \e[1;30m|' >> issue<br />
echo -e ' \e[0;36m/_\x27 `_\\\\ \e[1;30m| \e[35m\\l \e[0mon \e[1;33m\\n' >> issue<br />
echo -e ' \e[0m' >> issue<br />
echo -e '' >> issue<br />
<br />
Save the file, then {{ic|chmod +x issue}} and your done.<br />
<br />
To restore your original {{ic|issue}} just run the following: {{ic|mv /etc/issue /etc/issue.old && mv /etc/issue.bak /etc/issue}}.<br />
<br />
Credits & Original thread can be found here: https://bbs.archlinux.org/viewtopic.php?pid=386429#p386429</div>Crazy4108https://wiki.archlinux.org/index.php?title=Configure_virtual_console_colors&diff=218423Configure virtual console colors2012-08-17T13:24:13Z<p>Crazy4108: Virtual Console Login Screen</p>
<hr />
<div>[[Category:Eye candy]]<br />
The colors in the Linux virtual console running on the framebuffer can be changed. This is done by writing the escape code {{ic|\\e]PXRRGGBB}} where {{ic|X}} is the hexadecimal index of the color from 0-F, and {{ic|RRGGBB}} is a traditional hexadecimal RGB code.<br />
<br />
==Reusing ~/.Xdefaults settings==<br />
To reuse the color configuration from ~/.Xdefaults, add the following snippet to the shell init script ({{ic|.bashrc}}/{{ic|.zshrc}}/...).<br />
<br />
if [ "$TERM" = "linux" ]; then<br />
_SEDCMD='s/.*\*color\([0-9]\{1,\}\).*#\([0-9a-fA-F]\{6\}\).*/\1 \2/p'<br />
for i in $(sed -n "$_SEDCMD" $HOME/.Xdefaults | \<br />
awk '$1 < 16 {printf "\\e]P%X%s", $1, $2}'); do<br />
echo -en "$i"<br />
done<br />
clear<br />
fi<br />
<br />
==Virtual Console Login Screen==<br />
Changing the default Virtual Console Login screen.<br />
Take a backup of your original {{ic|/etc/issue}} like {{ic|mv /etc/issue /etc/issue.bac}}.<br />
Make a new file called {{ic|issue}} in your {{ic|/etc/}} folder and input the following below.<br />
<br />
echo -e '\e[H\e[2J' > issue<br />
echo -e ' \e[1;30m| \e[34m\\s \\r' >> issue<br />
echo -e ' \e[36;1m/\\\\ \e[37m|| \e[36m| | \e[30m|' >> issue<br />
echo -e ' \e[36m/ \\\\ \e[37m|| \e[36m| _ \e[30m| \e[32m\\t' >> issue<br />
echo -e ' \e[1;36m/ \e[0;36m.. \e[1m\\\\ \e[37m//==\\\\\\\\ ||/= /==\\\\ ||/=\\\\ \e[36m| | |/ \\\\ | | \\\\ / \e[30m| \e[32m\\d' >> issue<br />
echo -e ' \e[0;36m/ . . \\\\ \e[37m|| || || | || || \e[36m| | | | | | X \e[1;30m|' >> issue<br />
echo -e ' \e[0;36m/ . . \\\\ \e[37m\\\\\\\\==/| || \\\\==/ || || \e[36m| | | | \\\\_/| / \\\\ \e[1;30m| \e[31m\\U' >> issue<br />
echo -e ' \e[0;36m/ .. .. \\\\ \e[0;37mA simple, lightweight linux distribution. \e[1;30m|' >> issue<br />
echo -e ' \e[0;36m/_\x27 `_\\\\ \e[1;30m| \e[35m\\l \e[0mon \e[1;33m\\n' >> issue<br />
echo -e ' \e[0m' >> issue<br />
echo -e '' >> issue<br />
<br />
Save the file, then {{ic|chmod +x issue}} and your done.<br />
<br />
To restore your original {{ic|issue}} just run the following: {{ic|mv /etc/issue /etc/issue.old && mv /etc/issue.bak /etc/issue}}.<br />
<br />
Credits & Original thread can be found here: https://bbs.archlinux.org/viewtopic.php?pid=386429#p386429</div>Crazy4108https://wiki.archlinux.org/index.php?title=Openbox&diff=218421Openbox2012-08-17T12:57:56Z<p>Crazy4108: /* Openbox as a stand-alone WM */</p>
<hr />
<div>[[Category:Stacking WMs]]<br />
[[cs:Openbox]]<br />
[[es:Openbox]]<br />
[[fr:Openbox]]<br />
[[it:Openbox]]<br />
[[ko:Openbox]]<br />
[[lt:Openbox]]<br />
[[nl:Openbox]]<br />
[[pl:Openbox]]<br />
[[ru:Openbox]]<br />
[[sk:Openbox]]<br />
[[sr:Openbox]]<br />
[[tr:Openbox]]<br />
[[zh-CN:Openbox]]<br />
[[zh-TW:Openbox]]<br />
{{Article summary start}}<br />
{{Article summary text|A comprehensive guide on the installation and use of the Openbox window manager.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Graphical user interface overview}}}}<br />
{{Article summary end}}<br />
<br />
Openbox is a lightweight and highly configurable [[Window Manager|window manager]] with extensive standards support. Its features are documented at the [http://openbox.org/ official website]. This article pertains to installing Openbox under Arch Linux.<br />
<br />
== Installation ==<br />
<br />
Install {{Pkg|openbox}}, available in the [[Official Repositories]]. After installation, you should copy the default configuration files {{ic|rc.xml}}, {{ic|menu.xml}}, {{ic|autostart}}, and {{ic|environment}} to {{ic|~/.config/openbox}}:<br />
<br />
{{Note | Do this as a regular user, not as root.}}<br />
<br />
$ mkdir -p ~/.config/openbox<br />
$ cp /etc/xdg/openbox/{rc.xml,menu.xml,autostart,environment} ~/.config/openbox<br />
<br />
These four files form the basis of your openbox configuration. Each file addresses a unique aspect of your configuration and the role of each file is as follows:<br />
<br />
; {{ic|rc.xml}}: This is the main configuration file. It defines keyboard shortcuts, themes, virtual desktops, and more.<br />
<br />
;{{ic|menu.xml}}: This file defines the content of the right-click menu. It defines launchers for applications and other shortcuts. See the [[#Menus]] section.<br />
<br />
;{{ic|autostart}}: This file is read by openbox-session at startup. It contains the programs that are run at startup. It is typically used to set environment variables, launch panels/docks, set background image or execute other startup scripts. See the [http://openbox.org/wiki/Help:Autostart Openbox Wiki].<br />
<br />
;{{ic|environment}}: This file is sourced by openbox-session at startup. It contains environment variables to be set in Openbox's context. Any variables you set here will be visible to Openbox itself and anything you start from its menus.<br />
<br />
== Upgrading to Openbox 3.5 ==<br />
<br />
If you are upgrading to Openbox 3.5 or later from an earlier release, be aware of these changes:<br />
<br />
* There is a new config file called {{ic|environment}} that you should copy from {{ic|/etc/xdg/openbox}} to {{ic|~/.config/openbox}}.<br />
* The config file previously called {{ic|autostart.sh}} is now just called {{ic|autostart}}. You should rename yours to remove the {{ic|.sh}} from the end of the name.<br />
* Some of the configuration grammar in {{ic|rc.xml}} has changed. While Openbox appears to understand the old options, it would be wise to compare your configuration to the one in {{ic|/etc/xdg/openbox}} and look for changes that affect you.<br />
<br />
== Openbox as a stand-alone WM ==<br />
<br />
Openbox can be used as a stand-alone window manager (WM). This is usually simpler to install and configure than using Openbox with desktop environments. Running openbox alone may reduce your system's CPU and memory load.<br />
<br />
To run Openbox as a stand-alone window manager, append the following to {{ic|~/.xinitrc}}:<br />
exec openbox-session<br />
<br />
You may also start Openbox from the command shell (aka: text prompt) using {{ic|xinit}}:<br />
$ xinit /usr/bin/openbox-session<br />
<br />
If you used another window manager previously (such as Xfwm) and now Openbox will not start after logging out of X, try moving the autostart folder:<br />
mv ~/.config/autostart ~/.config/autostart.bak<br />
<br />
Using ConsoleKit, use this instead:<br />
exec ck-launch-session openbox-session<br />
<br />
If you also use PolicyKit and [[D-Bus]] (e.g. for automatically mounting drives in Nautilus/GNOME) use:<br />
exec ck-launch-session dbus-launch openbox-session<br />
<br />
{{Note | {{pkg|pyxdg}} is required for Openbox's xdg-autostart}}<br />
{{Note | {{ic|dbus-launch}} must be placed after {{ic|ck-launch-session}} or you will experience mounting problems.}}<br />
<br />
== Openbox as a WM for desktop environments ==<br />
<br />
Openbox can be used as a replacement window manager for full-fledged desktop environments. The method for deploying Openbox depends on the desktop environment.<br />
<br />
=== GNOME 2.24 and 2.26 ===<br />
Create {{ic|/usr/share/applications/openbox.desktop}} with the following lines:<br />
[Desktop Entry]<br />
Type=Application<br />
Encoding=UTF-8<br />
Name=OpenBox<br />
Exec=openbox<br />
NoDisplay=true<br />
# name of loadable control center module<br />
X-GNOME-WMSettingsModule=openbox<br />
# name we put on the WM spec check window<br />
X-GNOME-WMName=OpenBox<br />
In gconf, set {{ic|/desktop/gnome/session/required_components/windowmanager}} to {{ic|openbox}}:<br />
$ gconftool-2 -s -t string /desktop/gnome/session/required_components/windowmanager openbox<br />
Finally, choose the {{ic|GNOME}} session from the GDM sessions menu.<br />
<br />
=== GNOME 2.26 redux ===<br />
'''''If the previous guide for GNOME 2.24 fails:'''''<br />
<br />
If, when attempting to log into a "Gnome/Openbox" session -- and it consistently fails to start, try the following. This is one way of achieving your goal of using Openbox as the WM anytime you open a Gnome session:<br />
<br />
#Log into your Gnome-only session (it should still be using Metacity as its window manager).<br />
#Install Openbox if you have not done so already<br />
#Navigate your menus to ''System &rarr; Preferences &rarr; Startup Applications'' (possibly named 'Session' in older Gnome versions)<br />
#Open Startup Application, select '+ Add' and enter the text shown below. Omit the text after #.<br />
#Click the 'Add' button for the data entry window. Make sure the checkbox beside your new entry is selected.<br />
#Log out from your Gnome session and log back in<br />
#You should now be running openbox as your window manager.<br />
<br />
Name: Openbox Windox Manager # Can be changed<br />
Command: openbox --replace # Text should not be removed from this line, but possibly added to it<br />
Comment: Replaces metacity with openbox # Can be changed<br />
<br />
This creates a startup list entry which is executed by Gnome each time the user's session is started.<br />
<br />
=== GNOME 2.22 and prior ===<br />
# If you use GDM, select the "GNOME/Openbox" login option<br />
# If you use {{ic|startx}}, add {{ic|exec openbox-gnome-session}} to {{ic|~/.xinitrc}}<br />
# From the shell:<br />
$ xinit /usr/bin/openbox-gnome-session<br />
<br />
=== KDE ===<br />
# If you use KDM, select the "KDE/Openbox" login option.<br />
# Open System Settings > Default Applications (in the Workspace Appearance and Behaviour section), and change the default window manager to Openbox (this will also avoid having to log out and log back in again).<br />
# If you use startx, add {{ic|exec openbox-kde-session}} to {{ic|~/.xinitrc}}<br />
# From the shell:<br />
$ xinit /usr/bin/openbox-kde-session<br />
<br />
=== Xfce4 ===<br />
Log into a normal Xfce4 session. From your terminal, type:<br />
$ killall xfwm4 ; openbox & exit<br />
<br />
This kills xfwm4, runs Openbox, and closes the terminal. Log out, being sure to check the ''"Save session for future logins"'' box. On your next login, Xfce4 should use '''Openbox''' as its window manager.<br />
<br />
Alternatively, you can chooose ''Settings'' -> ''Session and Startup'' from menu, go to the ''Application Autostart'' tab and add {{ic|openbox --replace}} to the list of automatically started applications.<br />
<br />
To enable exiting from a session using ''xfce4-session'', edit {{ic|~/.config/openbox/menu.xml}}. If the file is not there, copy it from {{ic|/etc/xdg/openbox/}}. Look for the following entry:<br />
<item label="Exit Openbox"><br />
<action name="Exit"><br />
<prompt>yes</prompt><br />
</action><br />
</item><br />
<br />
Change it to:<br />
<item label="Exit Openbox"><br />
<action name="Execute"><br />
<prompt>yes</prompt><br />
<command>xfce4-session-logout</command><br />
</action><br />
</item><br />
<br />
Otherwise, choosing "Exit" from the root-menu causes Openbox to terminate its execution, leaving you with no window manager.<br />
<br />
If you have a problem changing virtual desktops with the mouse wheel skipping over desktops, edit {{ic|~/.config/openbox/rc.xml}}. Move the ''mouse binds with...'' actions "DesktopPrevious" and "DesktopNext" from context ''Desktop'' to the context ''Root''. Note that you may need to create a definition for the ''Root'' context as well.<br />
<br />
When using the Openbox root-menu instead of Xfce's menu, you may exit the Xfdesktop with this terminal command:<br />
$ xfdesktop --quit<br />
Xfdesktop manages the wallpaper and desktop icons, requiring you to use other utilities such as ROX for these functions.<br />
<br />
(When terminating Xfdesktop, the above issue with the virtual desktops is no longer a problem.)<br />
<br />
== Openbox for multihead users ==<br />
<br />
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.<br />
<br />
Openbox Multihead will function like normal Openbox when only a single head is available.<br />
<br />
A downside to using Openbox Multihead is that it breaks the EWMH assumption that one and only one desktop is visible at any time. Thus, existing pagers will not work well with it. To remedy this, {{AUR|pager-multihead}} can be found in the {{AUR}} and is compatible with Openbox Multihead. [http://imgur.com/a/cnZeq#y04nk Screenshots].<br />
<br />
Finally, a new version of [[PyTyle]] that will work with Openbox Multihead can also be found in the [[AUR]]: {{AUR|pytyle3-git}}.<br />
<br />
Both ''pytyle3'' and ''pager-multihead'' will work without Openbox Multihead if only one monitor is active.<br />
<br />
== Configuration ==<br />
<br />
There are several options for configuring Openbox settings:<br />
<br />
=== Manual configuration ===<br />
To configure Openbox manually, edit the {{ic|~/.config/openbox/rc.xml}} file with a text editor. The file has explanatory comments throughout, for more details about editing it see the [http://openbox.org/wiki/Help:Configuration Openbox wiki].<br />
<br />
=== ObConf ===<br />
[http://openbox.org/wiki/ObConf:About ObConf] is an Openbox configuration tool. It is used to set most common preferences such as themes, virtual desktops, window properties, and desktop margins. It can be installed with the {{Pkg|obconf}} package, available in the [[official repositories]].<br />
<br />
ObConf cannot configure keyboard shortcuts and certain other features. For these features edit {{ic|rc.xml}} manually. Alternatively, you can try {{AUR|obkey}} from the [[AUR]].<br />
<br />
=== Application customization ===<br />
<br />
Openbox allows per-application customizations. This lets you define rules for a given program. For example:<br />
* Start your web browser on a specific virtual desktop.<br />
* Open your terminal program with no window decorations (window chrome).<br />
* Make your bit-torrent client open at a given screen position.<br />
<br />
Per-application settings are defined in {{ic|~/.config/openbox/rc.xml}}. Instructions are in the file's comments. More details are found in the [http://openbox.org/wiki/Help:Applications Openbox wiki].<br />
<br />
== Menus ==<br />
<br />
The default Openbox menu includes a variety of menu items to get you started. Many of these items launch applications you do not want, have not installed yet, or never intend to install. You will surely want to customize '''{{ic|menu.xml}}''' at some point. There are a number of ways to do so.<br />
<br />
=== Manual configuration of menus ===<br />
<br />
You can edit {{ic|~/.config/openbox/menu.xml}} with a text editor. Many of the settings are self-explanatory. The article [http://openbox.org/wiki/Help:Menus Help:Menus] in the Openbox wiki has extensive details.<br />
<br />
=== Icons in the menu ===<br />
<br />
Since version 3.5.0 you can have icons next to your menu entries. To do that :<br />
# add <showIcons>yes</showIcons> in the <menu> section of the {{ic|rc.xml}} file<br />
# edit the menu entries in {{ic|menu.xml}} and add icons="<path>" like this :<br />
<menu id="apps-menu" label="SomeApp" icon="/home/user/.icons/application.png"><br />
<br />
then {{ic|openbox --reconfigure}} or {{ic|openbox --restart}} if the menus do not update properly.<br />
<br />
=== MenuMaker ===<br />
<br />
[http://menumaker.sourceforge.net/ MenuMaker] creates XML menus for several window managers including Openbox. MenuMaker searchs your computer for executable programs and creates a menu file from the result. It can be configured to exclude certain application types (GNOME, KDE, etc) if you desire. It can be installed with the {{Pkg|menumaker}} package available in the official repositories.<br />
<br />
Once installed, generate a menu file (named {{ic|menu.xml}}) by running the program.<br />
$ mmaker -v OpenBox3 # Will not overwrite an existing menu file.<br />
$ mmaker -vf OpenBox3 # Force option permits overwriting the menu file.<br />
$ mmaker --help # See the full set of options for MenuMaker.<br />
<br />
MenuMaker creates a comprehensive {{ic|menu.xml}}. You may edit this file by hand or regenerate it after installing software.<br />
<br />
=== Obmenu ===<br />
<br />
Obmenu is a menu editor for Openbox. This GUI application is the best choice for those who dislike editing XML code. Obmenu can be installed with the package {{Pkg|obmenu}}, available in the official repositories.<br />
<br />
Once installed, run {{ic|obmenu}} then add and remove applications as desired.<br />
<br />
==== Obm-xdg ====<br />
<br />
{{ic|obm-xdg}} is a command-line tool that comes with Obmenu. It generates a categorized sub-menu of installed GTK/GNOME applications.<br />
<br />
To use obm-xdg with other menus, add the following line to {{ic|~/.config/openbox/menu.xml}}:<br />
<menu execute="obm-xdg" id="xdg-menu" label="xdg"/><br />
<br />
Then add the following line under your ''root-menu'' entry where you want to have the menu appear:<br />
<menu id="xdg-menu"/><br />
<br />
Then run {{ic|openbox --reconfigure}} to refresh the Openbox menu. You should now see a sub-menu labeled '''xdg''' in your menu.<br />
<br />
To use obm-xdg by itself, create {{ic|~/.config/openbox/menu.xml}} and add these lines:<br />
<openbox_menu><br />
<menu execute="obm-xdg" id="root-menu" label="apps"/><br />
</openbox_menu><br />
<br />
{{Note|If you do not have GNOME installed, you need to install the package {{pkg|gnome-menus}} for obm-xdg.}}<br />
<br />
=== openbox-menu ===<br />
<br />
[http://mimasgpc.free.fr/openbox-menu_en.html Openbox-menu] uses [http://sourceforge.net/projects/lxde/files/menu-cache/ menu-cache] from the LXDE Project to create dynamic menus for Openbox.<br />
<br />
It can be installed with the package {{AUR|openbox-menu}}, available in the [[AUR]].<br />
<br />
=== Python-based xdg menu script ===<br />
<br />
This script is found in Fedora's Openbox package. You have only to put the script somewhere and create a menu entry. The latest version of the script can be found [http://pkgs.fedoraproject.org/cgit/openbox.git/tree/xdg-menu here].<br />
<br />
Download the script from the above repository and Place int into any directory you want.<br />
<br />
Open {{ic|menu.xml}} with your text editor and add the following entry. Of course, you can modify the label as you see fit.<br />
<menu id="apps-menu" label="xdg-menu" execute="python2 /path/to/xdg-menu"/><br />
<br />
Save the file and run {{ic|openbox --reconfigure}}.<br />
<br />
{{Note|If you do not have GNOME installed, you need to install the package {{pkg|gnome-menus}} for xdg-menu.}}<br />
<br />
=== Openbox menu generator ===<br />
<br />
The Openbox menu generator can be installed with the package {{AUR|obmenugen-bin}}, available in the AUR. creates the menu file from {{ic|.desktop}} files. Obmenugen provides a text file which filters (hides) menu items using basic regular expressions.<br />
$ obmenugen # Create a menu file<br />
$ openbox --reconfigure # To see the menu you generated<br />
<br />
=== Pipe menus ===<br />
<br />
Like other window managers, Openbox allows for scripts to dynamically build menus (menus on-the-fly). Examples are system monitors, media player controls, or weather monitors. Pipe menu script examples are found in the [http://openbox.org/wiki/Openbox:Pipemenus Openbox:Pipemenus] page at Openbox's site.<br />
<br />
Some interesting pipe menus provided by Openbox users:<br />
* {{App|obfilebrowser|A pipe menu file browser.|http://xyne.archlinux.ca/projects/obfilebrowser/|{{AUR|obfilebrowser}}}}<br />
* {{App|wifi-pipe|A pipe menu for scanning and connecting to wireless hot spots using netcfg.|https://github.com/pbrisbin/wifi-pipe|{{AUR?|wifi-pipe}}}}<br />
* {{App|obdevicemenu|A pipe menu for managing removable devices using Udisks.|https://bbs.archlinux.org/viewtopic.php?id&#61;114702|{{AUR|obdevicemenu}}}}<br />
<br />
== Startup programs ==<br />
<br />
Openbox supports running programs at startup. This is provided by command '''openbox-session'''.<br />
<br />
=== Enabling autostart ===<br />
<br />
There are two ways to enable autostart:<br />
# When using startx or xinit to begin a session, edit {{ic|~/.xinitrc}}. Change the line that executes '''''openbox''''' to '''openbox-session'''.<br />
# When using GDM or KDM, selecting an ''Openbox'' session automatically runs the autostart script.<br />
<br />
=== Autostart script ===<br />
<br />
Openbox provides a system-wide startup script which applies to all users and is located at {{ic|/etc/xdg/openbox/autostart}}. A user may also create his own startup script to be executed after the system-wide script by creating the file {{ic|~/.config/openbox/autostart}}. This file is not provided by default and must be created by the user.<br />
<br />
Further instructions are available in the [http://openbox.org/wiki/Help:Autostart Help:Autostart] article at the official Openbox site.<br />
<br />
{{Note|The autostart files used to be named autostart.sh prior to OpenBox 3.5.0. While these scripts will presently still work, users who are upgrading are advised to drop the .sh extension.}}<br />
{{Note|All the programs in the autostart file should be run as daemons or run in the background,otherwise the items in {{ic|/etc/xdg/autostart/}} won't be started!}}<br />
<br />
=== Autostart directory ===<br />
<br />
Openbox also starts any *.desktop files in {{ic|/etc/xdg/autostart}} - this happens regardless of whether a user startup script is present. {{ic|nm-applet}}, for example, installs a file at this location, and may cause it to run twice for users with the usual {{ic|(sleep 3 && /usr/bin/nm-applet --sm-disable) &}} in their startup script. There is a discussion on managing the effects of this at [https://bbs.archlinux.org/viewtopic.php?pid=993738].<br />
<br />
== Themes and appearance ==<br />
<br />
{{Box||See the main article: [[Openbox Themes and Apps#Themes and appearance]]|#E5E5FF|#FCFCFC}}<br />
<br />
=== Openbox themes ===<br />
<br />
Themes control the appearance of windows, titlebars, and buttons. They also control menu appearance and on-screen display (OSD). Some Openbox themes can be installed with the package {{Pkg|openbox-themes}}, available in the [[official repositories]].<br />
<br />
=== Cursors, icons, wallpapers ===<br />
<br />
Xcursor themes can be installed with the package {{Pkg|xcursor-themes}}, available in the official repositories, or with other packages from such as {{Pkg|xcursor-bluecurve}}, {{Pkg|xcursor-vanilla-dmz}} or {{Pkg|xcursor-pinux}}. Many other themes can be found in the official repositories or the [[AUR]].<br />
<br />
Icon themes are also available in the repositories, for example {{Pkg|lxde-icon-theme}}, {{Pkg|tangerine-icon-theme}} or {{Pkg|gnome-icon-theme}} can be found in the official repositories with many more in the [[AUR]].<br />
<br />
Wallpapers are easily set with utilities such as [[Feh]] or {{ic|hsetroot}}.<br />
<br />
Please see [[Openbox Themes and Apps]] for information on these GUI customizations.<br />
<br />
== Recommended programs ==<br />
<br />
{{Box||See the main article: [[Openbox Themes and Apps#Recommended programs]]|#E5E5FF|#FCFCFC}}<br />
<br />
== Tips and tricks ==<br />
<br />
===Aero snap behaviour===<br />
Windows 7 supports a unique window behaviour to snap windows when they are moved to the edge of the screen. This effect can also be achieved through an Openbox keybinding. More information [http://ubuntuforums.org/showthread.php?t=1796793 here].<br />
<br />
=== File associations ===<br />
Because Openbox and the applications you use with it are not well-integrated you might run into the issues with your browser. Your browser may not know which program it is supposed to use for certain types of files.<br />
<br />
A package in the AUR called {{AUR|gnome-defaults-list}} contains a list of file-types and programs specific to the Gnome desktop. The list is installed to {{ic|/etc/gnome/defaults.list}}.<br />
<br />
Open this file with your text editor. Here you can replace a given application with the name of the program of your choosing. For example, replace '''totem''' with '''vlc''' or '''eog''' with '''mirage'''. Save the file to {{ic|~/.local/share/applications/defaults.list}}.<br />
<br />
Another way of setting file associations is to install package {{Pkg|perl-file-mimeinfo}} from the official repositories and invoke '''mimeopen''' like this:<br />
mimeopen -d /path/to/file<br />
You are asked which application to use when opening {{ic|/path/to/file}}:<br />
Please choose a default application for files of type text/plain<br />
1) notepad (wine-extension-txt)<br />
2) Leafpad (leafpad)<br />
3) OpenOffice.org Writer (writer)<br />
4) gVim (gvim)<br />
5) Other...<br />
Your answer becomes the default handler for that type of file. Mimeopen is installed as {{ic|/usr/bin/perlbin/vendor/mimetype}}.<br />
<br />
=== Copy and paste ===<br />
<br />
From a terminal {{Keypress|Ctrl+Ins}} for copy and {{keypress|Shift+Ins}} for paste.<br />
<br />
Also {{keypress|Ctrl+Shift+c}} for copy and '''mouse middle-click''' for paste (in terminals).<br />
<br />
Other applications most likely use the conventional keyboard shortcuts for copy and paste.<br />
<br />
=== Window transparency ===<br />
<br />
The program {{Pkg|transset-df}} is available in the official repositories. With ''transset-df'' you can enable window transparency on-the-fly.<br />
<br />
For instance by placing the following in the ''<mouse>'' section you can have your mouse adjust window transparency by scrolling while hovering over the title bar:<br />
{{hc|~/.config/openbox/rc.xml|<nowiki><br />
<context name="Titlebar"><br />
. . .<br />
<mousebind button="Up" action="Click"><br />
<action name= "Execute" ><br />
<execute>transset-df -p .2 --inc </execute><br />
</action><br />
</mousebind><br />
<mousebind button="Down" action="Click"><br />
<action name= "Execute" ><br />
<execute>transset-df -p .2 --dec </execute><br />
</action><br />
</mousebind><br />
. . .<br />
</context><br />
</nowiki>}}<br />
{{Warning|It appears to work only when no additional actions are defined within the action group.}}<br />
<br />
=== Xprop values for applications ===<br />
Xprop can be installed with the package {{Pkg|xorg-xprop}}, available in the official repositories. <br />
<br />
If you use per-application settings frequently, you might find this bash alias handy:<br />
<br />
alias xp='xprop | grep "WM_WINDOW_ROLE\|WM_CLASS" && echo "WM_CLASS(STRING) = \"NAME\", \"CLASS\""'<br />
<br />
To use, run {{ic|xp}} and click on the running program that you would like to define with per-app settings. The result displays only the info that Openbox requires, namely the {{ic|WM_WINDOW_ROLE}} and {{ic|WM_CLASS}} (name and class) values:<br />
$ xp<br />
WM_WINDOW_ROLE(STRING) = "roster"<br />
WM_CLASS(STRING) = "gajim.py", "Gajim.py"<br />
WM_CLASS(STRING) = "NAME", "CLASS"<br />
<br />
==== Xprop for Firefox ====<br />
<br />
For whatever reason, Firefox and like-minded equivalents ignore application rules (e.g. ''<desktop>'') unless {{ic|class&#61;"Firefox*"}} is used. This applies irrespective of whatever values {{ic|xprop}} may report for the program's {{ic|WM_CLASS}}.<br />
<br />
=== Linking the menu to a button ===<br />
<br />
Some people want to link the Openbox menu (or any menu) to an object. This is useful for creating a panel button to pop up a menu. Although Openbox does not provide this, a program called {{Pkg|xdotool}} simulates a keypress. Openbox can be configured to bind that keypress to the ''ShowMenu'' action.<br />
<br />
After installing ''xdotool'', add the following to the ''<keyboard>'' section:<br />
{{hc|~/.config/openbox/rc.xml|<nowiki><br />
<keybind key="A-C-q"><br />
<action name="ShowMenu"><br />
<menu>root-menu</menu><br />
</action><br />
</keybind><br />
</nowiki>}}<br />
Then execute {{ic|openbox --reconfigure}} or {{ic|openbox --restart}} to use the new configuration. The following command summons a menu at your cursor position. The command may given as-is, linked to an object, or placed in a script.<br />
$ xdotool key ctrl+alt+q<br />
<br />
Of course, change the key shortcut to your liking. Here is a snippet from a [[Tint2]] configuration file which pops up a menu when the clock area is clicked. Each key combination is set to open a menu within Openbox's {{ic|rc.xml}} configuration file. The right‑click menu is different from the left‑click menu:<br />
clock_rclick_command = xdotool key --clearmodifiers "ctrl+XF86PowerOff"<br />
clock_lclick_command = xdotool key --clearmodifiers "alt+XF86PowerOff"<br />
<br />
=== Urxvt in the background ===<br />
<br />
With Openbox, running a terminal as desktop background is easy. You will not need [[Wikipedia:Devil's Pie (software)|devilspie]] here.<br />
<br />
First you must enable transparency, open your {{ic|~/.Xdefaults}} file (if it does not exist yet, create it).<br />
URxvt*transparent:true<br />
URxvt*scrollBar:false<br />
URxvt*geometry:124x24 #I do not use the whole screen, if you want a full screen term do not bother with this and see below.<br />
URxvt*borderLess:true<br />
URxvt*foreground:Black #Font color. My wallpaper is White, you may wish to change this to White.<br />
<br />
Then add the following to the ''<applications>'' section:<br />
{{hc|~/.config/openbox/rc.xml|<nowiki><br />
<application name="urxvt"><br />
<decor>no</decor><br />
<focus>yes</focus><br />
<position><br />
<x>center</x><br />
<y>20</y><br />
</position><br />
<layer>below</layer><br />
<desktop>all</desktop><br />
<maximized>true</maximized> #Only if you want a full size terminal.<br />
</application><br />
</nowiki>}}<br />
The ''magic'' comes from the '''<layer>below</layer>''' line, which place the application under all others. Here [[Rxvt-unicode|urxvt]] is displayed on all desktops, change it to your convenience.<br />
<br />
{{Tip|Instead of using ''<application name&#61;"urxvt">'', you can use another name ("urxvt-bg" for example), and use the {{ic|-name}} option when starting uxrvt. That way, only the urxvt terminals which you choose to name {{ic|urxvt-bg}} would be captured and modified by the application rule in {{ic|rc.xml}}. For example:<br />
$ urxvt -name urxvt-bg<br />
}}<br />
====ToggleShowDesktop exception====<br />
<br />
If you use '''ToggleShowDesktop''' to minimize all your application and show the desktop it will also minimize the urxvt window. Several methods are available to bypass this, but none works properly:<br />
* one method is explained in this [https://bbs.archlinux.org/viewtopic.php?pid=865844#p865844 forum post]. This involves editing Urxvt's source code.<br />
{{Warning|This method seems to have been broken in a recent update, now leading to a memory leak when the patched Urxvt is run.}}<br />
* the best method is outlined [https://bbs.archlinux.org/viewtopic.php?pid=929792#p929792 here]. It still has a big disadvantage: it makes ''ToggleShowDesktop'' a one-way action, not restoring the other desktop applications when ''ToggleShowDesktop'' is run for a second time. It does create the opportunity to use a different terminal emulator than Urxvt, however.<br />
<br />
=== Keyboard volume control ===<br />
====ALSA====<br />
If you use [[ALSA]] for sound, you can use the {{ic|amixer}} program (part of the {{Pkg|alsa-utils}} package) to adjust the sound volume. You can use Openbox's keybindings to map different shortcuts to actions. If you want to use the multimedia keys, but do not know their names, you could look at the [[Multimedia Keys]] page to find out.<br />
<br />
For example, add the following in the ''<keyboard>'' section:<br />
{{hc|~/.config/openbox/rc.xml|<nowiki><br />
<keybind key="W-Up"><br />
<action name="Execute"><br />
<command>amixer set Master 5%+</command><br />
</action><br />
</keybind><br />
</nowiki>}}<br />
This binds {{Keypress|Super+&uarr;}} to increase your master ALSA volume by 5%. Corresponding binding for volume down:<br />
{{hc|~/.config/openbox/rc.xml|<nowiki><br />
<keybind key="W-Down"><br />
<action name="Execute"><br />
<command>amixer set Master 5%-</command><br />
</action><br />
</keybind><br />
</nowiki>}}<br />
As another example you can also use the {{ic|XF86Audio*}} keybindings:<br />
{{hc|~/.config/openbox/rc.xml|<nowiki><br />
<keybind key="XF86AudioRaiseVolume"><br />
<action name="Execute"><br />
<command>amixer set Master 5%+ unmute</command><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioLowerVolume"><br />
<action name="Execute"><br />
<command>amixer set Master 5%- unmute</command><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioMute"><br />
<action name="Execute"><br />
<command>amixer set Master toggle</command><br />
</action><br />
</keybind><br />
</nowiki>}}<br />
The above example should work for the majority of multimedia keyboards. It should enable to raise, lower and mute the Master control of your audio device by using the respective multimedia keyboard keys. Notice also that in this example:<br />
<br />
* The "Mute" key should unmute the Master control if it is already in mute mode.<br />
* The "Raise" and "Lower" keys should unmute the Master control if it is in mute mode.<br />
<br />
====Pulseaudio====<br />
If you are using [[PulseAudio]] with ALSA as a backend the above keybinding are slightly different as {{ic|amixer}} must be told to use PulseAudio. As always, add the following to the ''<keyboard>'' section to get the proper behaviour:<br />
{{hc|~/.config/openbox/rc.xml|<nowiki><br />
<keybind key="XF86AudioRaiseVolume"><br />
<action name="Execute"><br />
<command>amixer -D pulse set Master 5%+ unmute</command><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioLowerVolume"><br />
<action name="Execute"><br />
<command>amixer -D pulse set Master 5%- unmute</command><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioMute"><br />
<action name="Execute"><br />
<command>amixer set Master toggle</command><br />
</action><br />
</keybind><br />
</nowiki>}}<br />
This keybindings should work for most of the systems. Other examples can be found [http://ubuntuforums.org/showthread.php?t=987149 here].<br />
<br />
== Troubleshooting Openbox 3.5 ==<br />
=== X server crashes ===<br />
Problems have been detected after upgrade to version 3.5, that the X server might crash in attempt to start Openbox, ending with this error message:<br />
(metacity:25137): GLib-WARNING **: In call to g_spawn_sync(), exit status of a child process \<br />
was requested but SIGCHLD action was set to SIG_IGN and ECHILD was received by waitpid(), so exit \<br />
status can't be returned. This is a bug in the program calling g_spawn_sync(); either do not request \<br />
the exit status, or do not set the SIGCHLD action.<br />
xinit: connection to X server lost<br />
waiting for X server to shut down<br />
In this particular case, some problem with '''metacity''' package has been identified as the cause of the X server crash issue. To solve the problem reinstall the {{Pkg|metacity}} and {{Pkg|compiz-decorator-gtk}} packages. If that does not solve the problem, try removing them.<br />
<br />
Also, plenty of similar cases have been found on the Internet, that not only metacity package might be causing the X server to crash.<br />
Thus, whatever else instead of metacity you get in the error output message, try to reinstall it (or remove if necessary) in an attempt to get rid of this X server crash.<br />
<br />
=== Autostarting unwanted applications in 3.5 ===<br />
If unwanted applications start with your Openbox session even though they are not listed in your {{ic|~/.config/openbox/autostart}}, check the {{ic|~/.config/autostart/}} directory, it might contain the residues from your previously used desktop environment (GNOME, KDE, etc.), and remove unwanted files.<br />
<br />
=== SSH agent no longer starting ===<br />
Whereas Openbox 3.4.x allowed launching an SSH agent from {{ic|~/.config/openbox/autostart}}, with 3.5 that no longer seems to work. You need to put the following code in {{ic|~/.config/openbox/environment}}:<br />
<br />
{{bc|<nowiki><br />
SSHAGENT="/usr/bin/ssh-agent"<br />
SSHAGENTARGS="-s"<br />
if [ -z "$SSH_AUTH_SOCK" -a -x "$SSHAGENT" ]; then<br />
eval `$SSHAGENT $SSHAGENTARGS`<br />
trap "kill $SSH_AGENT_PID" 0<br />
fi<br />
</nowiki>}}<br />
<br />
=== Openbox not registering with D-Bus ===<br />
Just like with SSH agent, lots of people used to have D-Bus code in {{ic|~/.config/openbox/autostart}} - which no longer works (e.g. Thunar does not see any removable devices anymore).<br />
<br />
The fix is to move the code to {{ic|~/.config/openbox/environment}}:<br />
{{bc|<br />
if which dbus-launch >/dev/null && test -z "$DBUS_SESSION_BUS_ADDRESS"; then<br />
eval `dbus-launch --sh-syntax --exit-with-session`<br />
fi<br />
}}<br />
<br />
Alternatively you can call {{ic|openbox-session}} with {{ic|dbus-launch}} in {{ic|~/.xinitrc}}.<br />
<br />
==See also==<br />
* [http://openbox.org/ Openbox Website] &ndash; The official website<br />
* [http://planetob.openmonkey.com/ Planet Openbox] &ndash; Openbox news portal<br />
* [http://www.box-look.org/ Box-Look.org] &ndash; A good resource for themes and related artwork<br />
* [https://bbs.archlinux.org/viewtopic.php?id=93126 Openbox Hacks and Configs Thread] @ Arch Linux Forums<br />
* [https://bbs.archlinux.org/viewtopic.php?id=45692 Openbox Screenshots Thread] @ Arch Linux Forums<br />
* [http://snott.net/linux/using-gnome3-with-openbox/ Using GNOME 3 with Openbox Tutorial]</div>Crazy4108