Openbox (Česky)

From ArchWiki
Revision as of 20:33, 5 June 2007 by Vkramar (Talk | contribs) (New page: Category:Desktop environments (Česky) Category:HOWTOs (Česky) = Instalace = Nejprve nainstalujme OpenBox z repozitáře Extra: pacman -S openbox Po nainstalování OpenBoxu j...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Nejprve nainstalujme OpenBox z repozitáře Extra:

pacman -S openbox

Po nainstalování OpenBoxu jsme vyzváni k překopívování souborů menu.xml a rc.xml do ~/.config/openbox/.

mkdir -p ~/.config/openbox/
cp /etc/xdg/openbox/rc.xml ~/.config/openbox/
cp /etc/xdg/openbox/menu.xml ~/.config/openbox/

Soubor rc.xml obsahuje množství různých nastavení pro OpenBox (nastavitelných např. pomocí OBconf). V menu.xml si můžeme upravit menu zobrazované při kliknutí pravým tlačítkem myši na ploše.

OpenBox lze spouštět buďto z XDM/KDM/GDM nebo pomocí startx. V případě XDM a startx je třeba upravit soubor ~/.xinitrc (jako příslušný uživatel):

exec openbox


OBConf je velice šikovný nástroj, který se určitě bude hodit. Nainstalovat jej můžeme z repozitáře Extra:

pacman -S obconf

Nyní již stačí jenom spustit OpenBox a na ploše kliknout pravým tlačím myši pro zobrazení hlavního menu...

Vytvoření výchozího menu pomocí menumaker

menumaker is a very usefull tool to create the xml-based menus for a various of WMs, and of course it works fine for OpenBox

First you have to get menumaker with pacman

pacman -S menumaker

as a normal user you can now run

mmaker -v OpenBox3

This will search your system for whatever applications you got, and adjust your ~/.config/openbox/menu.xml accordingly.

You can also use a utility like ObConf (available in the extra repository) or ObTuner (available in the AUR) to more easily edit your Openbox preferences.

Openbox themes

Themes for Openbox should be extracted to ~/.themes and can be changed with OBconf.

A good resource for themes is

Running programs at startup

There are two methods how to do this:

  • edit your ~/.xinitrc
  • run a script at openbox startup:

Edit your /etc/X11/sessions/openbox.desktop file:


Create /usr/bin/openbox-startup and change it's permissions to be executable:

touch /usr/bin/openbox-startup
chmod a+x /usr/bin/openbox-startup

Edit the openbox-startup:

dbus-launch openbox & 

(running openbox with dbus is optional, you can use just 'openbox')

Create ~/.config/openbox/startup and change it's permissions to be executable:

touch ~/.config/openbox/startup
chmod u+x ~/.config/openbox/startup

And edit it as you wish. Example:

feh --bg-scale ~/images/my_wallpaper.png
docker -vertical &
gaim &
xpad &

Additional programs

Background image

Openbox itself does not include a way to change the background image. This can be done with programs like Feh:

pacman -S feh

Feh is a lightweight image viewer that can be used to draw the desktop background with the command

feh --bg-scale /path/to/image.jpg

For the program to restore the last assigned image when Openbox starts, add this to your startup file (/.xinitrc):

eval `cat ~/.fehbg` &

Other programs you can use to do this are ImageMagick and xsetbg.

File managers

There are many possibilities, but the best lightweight file managers are ROX and Thunar. Also PCMan File Manager (pcmanfm) looks promising. For even more lightweight options, consider Gentoo or emelFM, both of which use the familiar 'Midnight Commander' two pane layout (these two require gtk 1.2.x).

Fonts in gtk apps

If you want to change the type and size of your fonts, add this to ~/.gtkrc.mine

style "user-font"
font_name = "[font-name] [size]"
widget_class "*" style "user-font"
gtk-font-name = "[font-name] [size]"

where "[font-name] [size]" is e.g "DejaVu Sans 10". You need to fill in both fields because of backwards compatibility.

Gtk/icon themes

No one likes the default gtk2 theme and you don't need to run gnome-settings-daemon to change it.

pacman -S gtk-theme-switch2

Run 'switch2' to change your gtk2 theme. If you want to change gtk1 theme, install 'gtk-theme-switch', and run 'switch'.

Changing icons is a little harder, you should only really do this if you use the nautilus file manager.

Download some icons, I recommend the Tango icons. Extract the icons in /usr/share/icons/ or ~/.icons.

Add this to ~/.gtkrc.mine:

gtk-icon-theme-name = "[name-of-icon-theme]"

Note: The icon theme name is the name of the folder in /usr/share/icons/ so if the folder was named archlinux-icons you would put archlinux-icons as the [name-of-icon-theme].

Icons on desktop

If you want icons on your desktop, you can use ROX or iDesk. ROX have one great advantage - it is also lightweight file manager.

Mouse cursor themes

To change this, download a theme and put the folder in /usr/share/icons or ~/.icons.

Add this to ~/.Xdefaults:

Xcursor*theme:   [name-of-cursor-theme]


There are quite a lot of panels you can install to provide a taskbar and pager to Openbox. The most common are:

Make your choice and add it to your startup file.

Run Program dialog

If you want a Run Program dialog that pops up when pressing Alt+F2, like in Gnome and KDE, you can use "gmrun"

pacman -S gmrun

Add the following entry to the <keyboard> section ~/.config/openbox/rc.xml

<keybind key="A-F2">
<action name="execute"><execute>gmrun</execute></action>

Using OpenBox with Gnome

  1. Install gnome.
  2. Setup ~/.xinitrc to run gnome: exec gnome-session
  3. Preferences -> Sessions -> Statup Programs
  4. As a high priority item, add: openbox --replace
  5. Restart Gnome, and you should be kickin!: (Openbox should replace Metacity, everytime that Gnome loads)

Per-application settings

Openbox has per-application settings since openbox 3.3 These settings can be set in ~/.config/openbox/rc.xml by creating new XML element inside <openbox_config> called <applications>, which will contain the settings. Inside <applications> you will need <application name=""> which will determine which application this setting is going to affect. The ways to determine the application are name, class and role, eg.

<application class="Firefox-bin">

The class and name can be found by running

xprop | grep WM_CLASS

When you click the application you want to configure, it will return something like

WM_CLASS(STRING) = "Gecko", "Thunderbird-bin"

The first one is what you put inside name="" and the latter one is for class="", you can use either one, but I prefer the one which doesn't get mixed with anything. After this you need to set the settings you want, available settings are

decor - whether window has borders, titlebar and so on, values yes or no, on or off 
shade - whether the window is shaded to the titlebar or not (doesn't work with decorations off), values yes, no, on, off and so on
position - position of the window when started needs subsection
 <x>pos</x>     - position on pixels reading from top left corner
 <y>pos</y>     - center as value and such work too, you can also leave x or y out if you only want to adjust one value.
focus - whether the window gets focused when starting it (not sure about this), values yes no and so on
desktop - desktop (workspace) the application starts, value desktop number reading from 0 (if its opened to another desktop, it doesn't get focused)
head - xinerama head the application starts (useful when you have 2 monitors and want the application to open in another, eg nvidia twinview uses xinerama), values 0 1 screennumber and such
layer - layer the application starts on, values Bottom, Normal and Top
iconic - wether the application is to be launched iconic, values yes, no, on, off and so on
skip_pager - application skips pager, values yes, no, on, off and so on
skip_taskbar - same as above, just taskbar, values yes, no, on, off and so on
fullscreen - whether app should be started fullscreen, values yes, no, on, off and so on
maximized - type of maximization, values Horizontal, Vertical, yes, no, on, off and so on.

Example config showing firefox opening 30 pixels from top centered with horizontal maximization

  <application class="Firefox-bin">

External Resources