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.
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.
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.
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.)
The rules are the most convenient way to influence the look of applications, reasons:
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()
void setState(int state)
void setDecoState(int state)
void start(QString name,int state,int decoState)
void start(QString name,QString settings)
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.
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) 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.