Openbox (Türkçe)
From ArchWiki
Contents
|
Özet
Openbox hafif ve tamamıyla özelleştirilebilir, gelişmiş bir pencere yöneticisidir. Özelliklerini resmi sitesinde detaylıca belgelenmiş halde bulabilirsiniz. Bu yazı Openbox'ın Arch Linux'te kurulumunu ve kullanımını anlatacaktır.
== Yükleme ==: Openbox öntanımlı Arch Linux depolarında var, yüklemek için
# pacman -S openbox
Yükleme tamamlanınca pacman, kurulumda oluşturulan örnek menu.xml ve rc.xml ayar dosyalarını ~/.config/openbox/ dizinine kopyalamanızı isteyecek, örneğin:
$ mkdir -p ~/.config/openbox/ $ cp /etc/xdg/openbox/rc.xml ~/.config/openbox/rc.xml $ cp /etc/xdg/openbox/menu.xml ~/.config/openbox/menu.xml
Note: Bu işlemi root yetkileriyle değil, sıradan bir kullanıcı olarak yapın.
rc.xml Openbox'ın temel ayar dosyasıdır. Kısayolları, temaları, çalışma alanlarını ve diğer özellikler buradan ayarlanır.
menu.xml ise masaüstünde sağ tıkladığınızda göreceğiniz Openbox menüsünü ayarlar. Öntanımlı gelen menü oldukça yetersiz, ama menüyü kendi ihtiyaçlarınıza göre düzenlemek çok kolay. Detaylı bilgi için aşağıdaki menü bölümünü okuyun ya da Openbox resmi sitesini ziyaret edin.
Başlarken
Openbox'ı Çalıştırmak
Openbox'ı tek başına çalıştırmak için ~/.xinitrc dosyasına şu satırı ekleyin ya da varsa bu satırın başından # işaretini kaldırın:
exec openbox-session
Openbox'ı Gnome'la Kullanmak
GNOME 2.24
İlk olarak /usr/share/applications/openbox.desktop dosyasını oluşturun, ve aşağıdaki satırları ekleyin:
[Desktop Entry] Type=Application Encoding=UTF-8 Name=OpenBox Exec=openbox NoDisplay=true # name of loadable control center module X-GNOME-WMSettingsModule=openbox # name we put on the WM spec check window X-GNOME-WMName=OpenBox
Sonra gconf'da /desktop/gnome/session/required_components/windowmanager seçimini openbox olarak ayarlayın:
gconftool-2 -s -t string /desktop/gnome/session/required_components/windowmanager openbox
Son olarak da, GDM'nin Oturumlar menüsünden GNOME'u seçerek masaüstü ortamınızı başlatın.
GNOME 2.22 ve daha eski sürümler
- GDM kullanıyorsanız, "GNOME/Openbox" seçeneğini kullanın,
- startx komutuyla başlatacaksanız, ~/.xinitrc dosyasına exec openbox-gnome-session satırını ekleyin,
- Kabuktan başlatmak için aşağıdaki komutu kullanın:
xinit /usr/bin/openbox-gnome-session
Openbox'ı KDE ile Kullanmak
- KDM kullanıyorsanız, "KDE/Openbox" seçeneğini kullanın,
- startx komutuyla başlatacaksanız, ~/.xinitrc dosyasına exec openbox-kde-session satırını ekleyin,
- Kabuktan başlatmak için aşağıdaki komutu kullanın:
$ xinit /usr/bin/openbox-kde-session
Openbox'ı Xfce4 ile Kullanmak
Xfce4 oturumunuzu her zaman olduğu gibi başlatın. Kullandığınız uçbirim arayüzünde aşağıdaki komutu çalıştırın:
$ killall xfwm4 ; openbox & exit
Bu komut xfwm4'ü sonlandırıp, Openbox'u çalıştıracak, ve uçbirim arayüzünü kapatacaktır.
Oturumunuzu kapatırken, "Save session for future logins" ayarını seçmeyi unutmayın.
Sonraki girişinizde, Xfce4 Pencere Yöneticisi (Window Manager [WM]) olarak Openbox'ı kullanacaktır.
Menüdeki kapatma komutunu Xfce4 oturumunu kapatmaya ayarlamak isterseniz, ~/.config/openbox/menu.xml dosyasını açın, eğer böyle bir dosya yoksa /etc/xdg/openbox/menu.xml yolundaki örnek dosyayı kopyalayın.
Şu bölümü bulun:
<item label="Exit Openbox"> <action name="Exit"> <prompt>yes</prompt> </action> </item>
Ve şu şekilde değiştirin:
<item label="Exit Openbox"> <action name="Execute"> <prompt>yes</prompt> <command>xfce4-session-logout</command> </action> </item>
Bunu yapmazsanız, menüdeki "Exit" seçeneği sadece Openbox'ı kapatıp, pencere yöneticisi olmadan kapatmayı yapmanızı gerektirecektir.
Eğer çalışma ortamları arasında masaüstündeyken fare tekerleğini kullanarak geçiş yapamıyorsanız, ~/.config/openbox/rc.xml dosyasını açın ve fare-işlem kısayolları bölümünde "DesktopPrevious" ve "DesktopNext" girişlerini "Desktop" bölümünden alıp "Root" bölümüne taşıyın. Eğer yoksa "Root" bölümünü sizin oluşturmanız gerekebilir.
Xfce4'ünki yerine Openbox'un menüsünü kullanmak isterseniz, terminalde aşağıdaki komutu çalıştırarak Xfdesktop'ı sonlandırmanız gerekebilir:
$ xfdesktop --quit
Bilmeniz gerekir ki, Xfdesktop duvar kağıtlarını, ikonları vb. de düzenler, bu yüzden Xfdesktop işlemini durdurmanız ROX gibi başka yazılımlara ihtiyaç duymanıza neden olabilir.
(Xfdesktop'ı durdurunca, çalışma ortamlarını değiştirmekle ilgili değindiğimiz çözüm geçerliliğini yitirecektir.)
Ayarlar
Tercihler
Openbox tercihlerinizi ayarlamak için iki seçeneğiniz var, ya rc.xml dosyasını elle düzenleyeceksiniz ya da ObConf'u kullanacaksınız.
Elle Ayarlamak
Openbox tercihlerini elle ayarlamak için ~/.config/openbox/rc.xml dosyasını düzenlemeniz gerekiyor. Ayar dosyası temel işlemler için gerekli bilgileri içeriyor, daha fazlası gerekirse resmi sitesinde bulabilirsiniz.
ObConf Kullanarak Ayarlamak
ObConf grafik arayüzlü Openbox tercih aracıdır. Temalar, çalışma alanları gibi temel ayarları yapmak için kullanabilirsiniz
ObConf'u yüklemek için aşağıdaki komutu çalıştırın:
# pacman -S obconf
Uyarı: ObConf klavye kısayolları ve bazı gelişmiş ayarları yapamıyor. Bu ayarlamalar için rc.xml dosyasını elinizle düzenlemelisiniz (yukarıya bakın.)
Menu Yönetimi
Öntanımlı Openbox menüsü, size başlangıçta yardımcı olmak için bir çok program kısayoluyla birlikte gelir, bu kısayolları değiştirmek için izlemeniz gereken bir kaç yol vardır:
Elle ayarlamak
Aynı rc.xml dosyası gibi, ~/.config/openbox/menu.xml dosyasını da istediğiniz metin editörüyle düzenleyebilirsiniz. Although many of the settings are self-explanatory, full documentation is available.
MenuMaker
MenuMaker is a powerful tool that creates XML-based menus for a variety of Window Managers, including Openbox. MenuMaker will search your computer for executable programs and create an XML menu based on the results. It can be configured to exclude Legacy X, GNOME, KDE, or Xfce applications if the user desires.
MenuMaker is available in the community repository:
# pacman -S menumaker
Once installed, you can generate a complete menu by running:
$ mmaker -v OpenBox3
By default, MenuMaker will not overwrite an existing menu.xml. To do so, run it with the -f (force) argument:
$ mmaker -vf OpenBox3
To see a full list of options, run mmaker --help
This will give you a pretty thorough menu. Now you can modify the menu.xml by hand, or simply regenerate the list whenever you install new software.
Obmenu
Obmenu is a GUI-based menu editor for Openbox. For those who don't enjoy editing XML source code, this is probably the best option for you.
It is available in the community repository:
# pacman -S obmenu
Once installed, simply run obmenu and add or remove the desired applications.
obm-xdg
obm-xdg is a command-line tool that comes with Obmenu. It can generate a categorized sub-menu of installed GTK/GNOME applications.
To use obm-xdg, add the following line to ~/.config/openbox/menu.xml:
<menu execute="obm-xdg" id="xdg-menu" label="xdg"/>
Then run openbox --reconfigure to refresh the Openbox menu. You should now see a sub-menu labeled xdg in your menu.
NOTE: If you do not have GNOME installed, then you need to install gnome-menus package for obm-xdg to work.
Startup Programs
Openbox features support for running programs at startup. This is provided by the "openbox-session" command.
There are two ways to enable autostart:
- If you use startx/xinit to log into your X session, edit ~/.xinitrc and change the line that executes openbox to execute openbox-session instead.
- If you log in with GDM/KDM, then select the Openbox session and it will automatically use autostart.
Startup programs are managed in ~/.config/openbox/autostart.sh. Full instructions and best practices for how to do this are available at the Openbox website.
Per-application settings
Openbox features per-application settings, allowing you to define rules for your programs. For example, you can:
- load your web browser on a certain desktop
- load your terminal without a window border
- load your torrent client at a certain position on your screen
These are defined in ~/.config/openbox/rc.xml. As you might expect, the instructions are well-documented within the file itself. Full details can also be found here: http://icculus.org/openbox/index.php/Help:Applications
Theming and Appearance
With the exception of the Openbox Themes topic, the following section is intended for users who have configured Openbox to run as a standalone desktop, without the assistance of GNOME, KDE or Xfce.
Openbox Themes
Openbox themes control the appearance of window borders, including the titlebar and titlebar buttons. They also determine the appearance of the application menu and on-screen display (OSD).
Additional themes are available from the standard repositories:
# pacman -S openbox-themes
This package is by no means definitive. You can download more themes at websites such as:
- box-look.org
- customize.org
- http://www.minuslab.net/themes/
- http://celo.wordpress.com/themes/
- http://vault.openmonkey.com/pages/openbox
- http://hewphoria.com/?p=submission&type=theme&cat=7
Downloaded themes should be extracted to ~/.themes and can be installed or selected with the ObConf tool.
Creating new themes is fairly easy and again well-documented.
Desktop Wallpaper
Openbox itself does not include a way to change the wallpaper. This can be done easily with programs like Feh or Nitrogen. Other options include ImageMagick, hsetroot and xsetbg.
GTK Themes
GTK2/GTK+
GTK+ themes can be managed easily with the lxappearance, gtk-chtheme, or switch2 utilities. To install, run:
# pacman -S lxappearance
and/or
# pacman -S gtk-chtheme
and/or
# pacman -S gtk-theme-switch2
Now you can simply run lxappearance, gtk-chtheme or switch2 to set the desired theme.
GTK1
For legacy GTK1 themes, install the gtk-theme-switch package:
# pacman -S gtk-theme-switch
Then run switch to select a desired theme.
GTK Fonts
Manually edit the config file
If you want to change the type and size of your fonts, add the following 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 the desired font and point size. For example:
style "user-font" { font_name = "DejaVu Sans 8" } widget_class "*" style "user-font" gtk-font-name = "DejaVu Sans 8"
Both font_name and gtk-font-name fields are required for backwards compatibility.
Use GUI tools
You can use gtk-chtheme or lxappearance to set GTK font settings. Please refer to the above section.
GTK Icons
First, extract the desired icon theme to /usr/share/icons (system-wide access) or ~/.icons (local user access), then:
Manually edit the config file
Add the following to ~/.gtkrc.mine:
gtk-icon-theme-name = "[name-of-icon-theme]"
where [name-of-icon-theme] is the name of the icon theme directory. For example:
gtk-icon-theme-name = "Tango"
Ensure ~/.gtkrc-2.0 is configured to parse ~/.gtkrc.mine:
# ~/.gtkrc-2.0 # -- THEME AUTO-WRITTEN DO NOT EDIT include "/usr/share/themes/Rezlooks-Gilouche/gtk-2.0/gtkrc" include "/home/username/.gtkrc.mine" # -- THEME AUTO-WRITTEN DO NOT EDIT
Use GUI tools
You can use lxappearance to choose GTK icon themes. Please refer to the above section.
Mouse cursor themes
Extract the desired Xcursor theme to either /usr/share/icons (system-wide access) or ~/.icons (local user access).
Add this to ~/.Xdefaults:
Xcursor.theme: [name-of-cursor-theme]
where [name-of-cursor-theme] is the name of the cursor theme directory. For example:
Xcursor.theme: Vanilla-DMZ-AA
To change the size:
Xcursor.size: [size]
Desktop Icons
Openbox does not provide a means to display icons on the desktop. PcmanFM, ROX, iDesk, or even Nautilus (and the gnome-settings-daemon) can provide this function.
ROX and PCmanFM have the additional advantage of being lightweight file managers.
Tips & Tricks
Improve Fonts
Improve the appearance of fonts for LCD monitors by following this guide.
Then, create ~/.fonts.conf and add:
<?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> <match target="font" > <edit mode="assign" name="rgba" > <const>rgb</const> </edit> </match> <match target="font" > <edit mode="assign" name="hinting"> <bool>true</bool> </edit> </match> <match target="font" > <edit mode="assign" name="hintstyle"> <const>hintfull</const> </edit> </match> </fontconfig>
Recommended Programs
Login Managers
SLiM provides a lightweight and elegant graphical login solution for standalone Openbox configurations. Refer to Arch's SLiM wiki for detailed instructions.
Composite Desktop
Xcompmgr is a lightweight composite manager capable of rendering drop shadows, fading and simple window transparency within Openbox and other window managers.
Application Launchers
dmenu
Set-up dmenu as described in the dmenu wiki article. Then, add the following entry to the <keyboard> section ~/.config/openbox/rc.xml to enable a shortcut to launch dmenu:
<keybind key="W-p"> <action name="Execute"> <command>~/path/to/your/dmenu-script</command> </action> </keybind>
Gmrun
gmrun provides an excellent Run dialog box, similar to the Alt+F2 features found in Gnome and KDE:
pacman -S gmrun
Add the following entry to the <keyboard> section ~/.config/openbox/rc.xml to enable Alt+F2 functionality:
<keybind key="A-F2"> <action name="execute"><execute>gmrun</execute></action> </keybind>
Bashrun
bashrun provides a different, barebones approach to a run dialog, using a specialized bash session within a small xterm window. It is available in the community repository and can be launched through the Alt+F2 style approach mentioned previously. To make bashrun act more like a traditional run dialog, add the following entry to the <applications> section ~/.config/openbox/rc.xml:
<application name="bashrun"> <desktop>all</desktop> <decor>no</decor> # switch to yes if you prefer a bordered window <focus>yes</focus> <skip_pager>yes</skip_pager> <layer>above</layer> </application>
Launchy
Launchy is a less minimalistic approach; it is skinnable and offers more functionality such as a calculator, checking the weather, etc. Originally for Windows, similar to Gnome Do.
pacman -S launchy
It is launched by Ctrl + Space key combination.
LXPanel
LXPanel If LXPanel is used as a taskbar manager, the run utility from the LXPanel menu can be executed with "lxpanelctl run".
File managers
There are many possibilities, but the most popular lightweight file managers are:
- Thunar. Thunar supports auto-mount features and other plugins.
pacman -S thunar
Thunar may be started in daemon mode for tighter desktop integration. For instance, inserting a USB pendrive will invoke a Thunar window to popup, with the drive contents listed in the window.
To start Thunar in daemon mode, edit ~/.config/openbox/autostart.sh and add:
thunar --daemon &
- ROX (ROX provides desktop icons)
pacman -S rox
- PCMan (pcmanfm also provides desktop icons)
pacman -S pcmanfm
For even lighter options, consider Gentoo or emelFM, both of which use the familiar 'Midnight Commander' two pane layout (these two require gtk 1.2.x).
Of course, you can also use GNOME's Nautilus. Although slower than the above solutions, it has the additional advantage of VFS support (e.g. remote SSH, FTP and Samba connections).
Clipboard Managers and copy/paste
You may wish to install a clipboard manager for feature rich copy/paste ability. xfce4-clipman-plugin, parcellite, or glipper-old may be installed via pacman. Add your choice to autostart.sh. From the terminal, Ctrl+Insert as copy and Shift+Insert as paste generally works as well. You may also copy from terminal with Ctrl+Shift+C, and paste with mouse middle click.
Panels, Trays, and Pagers
There are quite a lot of utilities available that provide a panel (taskbar), system tray, and pager to Openbox. The most common are:
Panels
- PyPanel
- bmpanel
- Tint2
- LXPanel
- fbpanel
- PerlPanel
- fspanel
- xfce4-panel
- gnome-panel
- avant-window-navigator
- cairo-dock
- wbar
Trays
Pagers
Make your choice and add it to your startup file.
Get xprop values for per-app settings quickly
If you use per-application settings frequently, you might find this bash alias handy:
alias xp='xprop | grep "WM_WINDOW_ROLE\|WM_CLASS" && echo "WM_CLASS(STRING) = \"NAME\", \"CLASS\""'
To use, run xp and click on the running program that you'd like to define with per-app settings. The result will display only the info that Openbox requires, namely the WM_WINDOW_ROLE and WM_CLASS (name and class) values:
[thayer@dublin:~] $ xp WM_WINDOW_ROLE(STRING) = "roster" WM_CLASS(STRING) = "gajim.py", "Gajim.py" WM_CLASS(STRING) = "NAME", "CLASS"
Firefox/Gran Paradiso application rules
For whatever reason, Firefox and its open source equivalents will ignore application rules (e.g. <desktop>) unless class="Firefox*"
is used, regardless of what xprop reports as the actually WM_CLASS values.
Linking the menu to a command
Some people would want to link the Openbox main menu, or any other, to a command. This is useful for creating a menu button in a panel, for example. Although Openbox doesn't support this, a very simple script , xdotool, can simulate a keypress by running a command. Xdotool is available on AUR. To use it, simply add the following code to the <keyboard> section of your rc.xml:
<keybind key="A-C-q"> <action name="ShowMenu"> <menu>root-menu</menu> </action> </keybind>
Restart/reconfigure Openbox. You can now magically summon your menu at your cursor position by running the following command:
# xdotool key ctrl+alt+q
Of course, you can change the shortcut to your liking.
Urxvt in the background
With Openbox, running a terminal as desktop background is easy. You won't need devilspie here.
First you must enable transparency, open your .Xdefaults file (if it doesn't exist yet, create it in your home folder).
URxvt*transparent:true URxvt*scrollBar:false URxvt*geometry:124x24 #I don't use the whole screen, if you want a full screen term don't bother with this and see below. URxvt*borderLess:true URxvt*foreground:Black #Font color. My wallpaper is White, you may wish to change this to White.
Then edit your .config/openbox/rc.xml file :
<application name="urxvt"> <decor>no</decor> <focus>yes</focus> <position> <x>center</x> <y>20</y> </position> <layer>below</layer> <desktop>all</desktop> <maximized>true</maximized> #Only if you want a full size terminal. </application>
The magic comes from the <layer>below</layer> line, which place the application under all others. Here Urxvt is displayed on all desktops, change it to your convenience.
Additional Resources
- Openbox Website - The official website
- Planet Openbox - Openbox news portal
- Box-Look.org - A good resource for themes and related artwork
- Application recommendations