How to train a Panther

Outlet.. err ...line

This tutorial is adressed to the advanced user who wants to have more control over his desktop and make use of all the features Baghira has.

A heterogeneous Desktop

Apple has now had five releases of OS X (Tiger is OS X 10.4) and they slightly changed the look from time to time.
Now one could argue that this is crap and all applications should look the same, but i disagree: As long as the key elements (Buttons aso.) are remindable and visually connected between the different versions, this is completely ok to me and can give you a "colorfull" Desktop.

Introducing the Looks

There are two major Looks: one is Aqua and the other is the brushed metal look, that was used by QuickTime for a long time.

Aqua had a major visual break from 10.2 (Jaguar) to 10.3 (Panther) - indicating that Apple refreshed things under the screen as well (some people say that Panther was the first usable OS X - especially people that don't knwo what a shell is ;)
Then there was a minor visual step from 10.3 to 10.4 (Tiger), mostly to honor Spotlight, i guess.

The brushed Metal Look was allways used with QuickTime (well i can't remember it was not since OS X) but became really famous and more and more common with iTunes.
Referencing Apple,

You can use a brushed metal window if your application:

  • Is a single-window application that provides a source list to navigate information for example, iTunes or the Finder
  • Strives to re-create a familiar physical device Calculator or DVD Player, for example
  • Provides an interface for a digital peripheral, such as a camera, or an interface for managing data shared with digital peripherals iPhoto or iSync, for example

You should not use a brushed metal window if your application:

  • Is a multi-window application for example, Interface Builder
  • Is a document-based application for example, TextEdit

Use the brushed metal window look for the primary application window and other windows that meet the above criteria for example, the Equalizer window in iTunes. Don't use it for supporting windows, such as preferences and other dialogs. It is acceptable to have a mix of standard Aqua windows and brushed metal windows within an application, as the Finder does.

Baghira vs. Apple

On OS X the applications (or rather their developers) choose their look - Baghira allows you to do that yourself.

You can start any application in every look at every time (so run one instance of konqueror Aqua and one Brushed Metalled) but you cannot run one application in different styles (so if the style is Brushed Metal, the dialogs will appear that way as well - allthough the HIG recommands something different).

You can also mix around a lot (i.e. activate the scanlines for each style combine different styles with decos, select iTunes Buttons with the Aqua look aso.)

How to do that

The rules

The rules are the most convenient way to influence the look of applications, reasons:

The backdraws are, that you need to enter the config dialog and can't "play" with the apps, i.e. run a brushed metal version of konqueror now and a Panther one then... well theoretically (later more)

  1. Right click bab and then press the "Configure Baghira" button.
  2. Open the "Rules" tab and start adding rules.
  3. The first element holds the applications name.
    It's important to use the correct args[0] - there's a detect button, but it's not for certain
  4. The rest should be pretty easy - much fun on configuring apps ;)
Note: You can also define rules for non existent application, e.g. "Milk". You'll see why this is interesting...

BAB - Sytray icon

Jaguar Panther Brushed Metal Tiger Milk

Right after starting bab, you'll see a nice Systray icon. By leftclicking it, you can jump through the predefined styles:
Jaguar Panther Brushed Metal Tiger Milk.
You can modify the settings of these (virtual) predefinitions using the config dialog - if you delete them, the global config will be used instead.


BAB also provides a DCOP interface. (DCOP is KDEs inter process communication system)
You can try out that by using the shell DCOP client, simply type:

dcop bab default

"dcop" is the client, "bab" the process name that BAB registered to DCOP and "default" simply calls the default DCOP object (there are others, but not interesting for our purpose, leave the "default" to see them).
The answer will be a long list of the functions BAB's default DCOP object provides.

dcop bab default QCStringList interfaces()
QCStringList functions()
void toggleState()
int state()
void setState(int state)
int decoState()
void setDecoState(int state)
void start(QString name,int state,int decoState)
void start(QString name,QString settings)
void emitStyleChanged()

The first two are DCOP internal stuff and not interesting, "toggleState" simply lets you change the states as if you clicked the icon, but you need no mouse.
"state" resp. "decoState" will return the current values for the ... well guess (integer, the counting starts with '0')
"setState" and "setDecoState" can be used to call a design directly (e.g.)

dcop bab default setState 2_

Will set the current design (not the windeco, i.e. the titlebar!) to Panther and "emitStyleChanged" is mainly for baghira internal purposes (it will call every application and request to please update the style, i.e. what the config dialog e.g. does).

The most interesting function may be the "start" one.
They allow you to call an application with specific designs for the Style and Window Decoration - regardless from the values in the config dialog, the currently active style (bab icon!), or the predefined look of the application, e.g.

dcop bab default start konqueror Milk Milk_

will open a milky Konqueror window, even though you may have predefined konqueror to use a Brushed Metal appereance and the active design is Panther.

Tricking around

Now about the more minor stuff.
Thinking of OS X, you have two applications (Finder and Safari) that are functionally covered by one KDE application (Konqueror) - worse, you may be willing to use a Auqa'ish filebrowser ("Finder") and a Brushed Webbrowser ("Safari") - though this is really useless stuff, hey - it's possible, so why not do it?

The key aspect is that applications can be distinguished by their name (argv[0]) and that a symlink to "konqueror", named "Safari" will allways appear as "Safari", though technically, it's the same file. Example:

First, make a symlink to konqueror and name it "Safari". (You'll need root permissions for this or create the files in your local bin dir.)

cd $(kde-config --prefix)/binln -s konqueror Safari

Then create a script named "safari" (1st, because you cannot have two "Safari"s in the same dir; 2nd, because you save a "shift" when typing the name ;)
The script is necessary to tell konqueror to not use "Konqueror" as window caption (also used in the menubar kicker applet), but "Safari" and also to call konquerors "webbrowsing" profile.

Safari --profile webbrowsing --caption Safari $* &

If you now define a nice "Safari" predefinition and call the "safari" script... well just try and see.