\n"; ?>
Linux auf dem Desktop

Blackbox - the Best Window Manager - Part 2

Mario Behnke
Translation: Jana Jaeger

This time, you' ll read about the following topics:

Editing the Blackbox Menu

"Out of the box" blackbox ships with a standard menu. This menu is just meant as an example - it can easily be modified. Let's learn how to do that:

First of all, make sure that your /home directory contains a subdirectory called .blackbox. If this is not yet the case, go and create it:

     mkdir ~/.blackbox

Now you'll start to fill this directory by copying the standard menu from /usr/share/Blackbox/menu:

     cp /usr/share/Blackbox/menu ~/.blackbox/Menu

Tell blackbox's configuration file (.blackboxrc) where to look for your menu file. Just edit ~/.blackboxrc:

     vi ~/.blackboxrc

Look out for the following line:

     session.menuFile:       /usr/share/Blackbox/menu

And replace it by:

     session.menuFile:       ~/.blackbox/Menu

Save your changes and exit the editor. Restart blackbox - choose Restart from the blackbox menu or log out and log in again.

Now you can go for it - customize the menu file. Open the menu file:

     vi ~/.blackbox/Menu

All lines beginning with # are meant as comments and will be ignored by blackbox. To make sure your menu provides a minimum functionality, it should at least contain the following lines:

	[begin] (Blackbox 0.61.x)
	  [exec] (xterm)    {xterm -ls}
	  [nop]
	  [submenu] (Styles) {Choose a style...}
	    [stylesdir] (/usr/share/Blackbox/styles)
	  [end]
	  [workspaces] (Workspace List)
	  [config] (Configuration)
	  [reconfig] (Reconfigure)
	  [restart] (Restart)
	  [exit] (Exit)
	[end]

The syntax of the menu file is almost self-explanatory. Each line should consist of the following elements:

     [tag] (description or file name) {command or file name}

Mind to stick to the given sequence of brackets ([] -> () -> {}).

The menu as a whole is enclosed between the [begin] and the [end] tag. All you have to do is to place your own menu options in between. You may use the following tags - the syntax of each tag and an (optional) example are provided.

[begin] (title of your menu)

Blackbox needs this tag in order to find the start of the menu in the configuration file.

[begin] (My Blackbox Menu)

[end]

[end] marks the end of the main menu or one of its submenues. Each menu/submenu needs its own corresponding end tag.

[exec] (description of a command) {shell command}

This string is used to add a shell command.

[exec] (Netscape Navigator 4.77) {/usr/X11R6/bin/netscape}

[exit] (exit)

Adds an Exit option to end blackbox.

[exit] (Time to Say Good-Bye)

[nop] (description - optional)

This position has no function at all - except for keeping your menu clearly arranged ... . Choose one of the following tags to separate the menu sections from each other - if you wish :)

     [nop] ( -------------- ) or
     [nop] ( ************** )
     [nop]

[submenu] (description of a submenu) {title of the submenu - optional}

This tag marks the beginning of a submenu. Always end these sections properly with an [end] tag.

     [submenu] (Games) {my games}
        [exec] (Soldier of Fortune) {/usr/local/games/sof/sof}
     [end]

 

Blackbox Styles (Themes)

Handling themes under blackbox is not as easy as it is for other window managers since it provides no graphical front end. Get fresh themes for blackbox from http://www.themes.org/themes/blackbox/.

Adding a new themes requires some preparations to be taken in your .blackbox file before the the actual download is performed.

     mkdir ~/.blackbox/Styles/
     mkdir ~/.blackbox/Backgrounds/

Styles is meant to contain the actual style files and Backgrounds will contain background images (these are optional - some themes don't need them.)

For a start, you may copy the standard style files from /usr/share/Blackbox/styles/ to your Styles directory.

     cp /usr/share/Blackbox/styles/* ~/.blackbox/Styles/

Make sure the menu configuration file contains the correct link to your styles directory:

     vi ~./blackbox/Menu

Replace this line

     [stylesdir] (/usr/share/Blackbox/styles)

by

     [stylesdir] (~/.blackbox/Styles/)

You don't need to restart blackbox to see the effect of your changes - any time you rightclick the menu, the menu file is reread.

Download

This is the procedure for an "ideal" theme. There are different ways to organize style packages - so the directories might slightly differ. You might find styles that contain their own styles and backgrounds directories, but there are also packages containing a bare style file and the .jpg background image.

Now for the actual downloads: Create a subdirectory /tmp/bbthemes.

     mkdir /tmp/bbthemes

This is where you download the style to and where you will check its content (Midnight Commander might prove a suitable tool for this) and finally unpack it.

Alternatively, you might change to the directory using the command line

     cd /tmp/bbthemes  (change to my download directory)

Unpack the theme:

     tar zxvf example.tar.gz

and copy the background image from the backgrounds directory to your Backgrounds directory.

     cp backgrounds/example.jpg ~.blackbox/Backgrounds/

or

     cp Backgrounds/example.jpg ~.blackbox/Backgrounds/

The same procedure is applied to the style file:

     cp styles/style ~.blackbox/Styles

or

     cp Styles/style ~.blackbox/Styles

Open the style file in an editor for a closer inspection.

     vi ~/.blackbox/Styles

Look out for this line and change it if necessary:

     rootCommand: xv -root -quit -smooth -max
     ~/.blackbox/Backgrounds/Example.jpg

(Example stands for the name of your theme.) This line points to the .jpg background images of your theme. Normally, the image file will carry the same name as the theme itself.

Should you encounter a line like this

     rootCommand: bsetroot -gradient flatcrossdiagonalgradient
     -from rgb:4/6/8 -to rgb:3/48/6

the theme doesn't use a background image.

What's Awaiting You in Part Three?

The third an final part of this series deals with blackbox tools and their use with "Slit".

Any questions, suggestions or remarks on blackbox? Send us an email.

P.S.: Any line breaks in code or command lines were inserted for the sake of a better print version of this article. In real life, these lines are applied without them.

\n"; ?>