Per-instance application settings in Openbox

lxdeopenbox

I need to run two instances of the same program, and have different Openbox properties for each.

Lets say, I want to run two instances of Thunderbird. Even when I create two symlinks, i.e.

/usr/bin/icedove-1
/usr/bin/icedove-2

both instances still have the same NAME and TITLE:

$ obxprop | egrep '_OB_APP'
_OB_APP_TYPE(UTF8_STRING) = "normal"
_OB_APP_TITLE(UTF8_STRING) = "Icedove Mail/News"
_OB_APP_CLASS(UTF8_STRING) = "Icedove"
_OB_APP_NAME(UTF8_STRING) = "Mail"
_OB_APP_ROLE(UTF8_STRING) = "3pane"

How can I distinquish between two instances of the same program?

Can I start a program with a parameter, which will change the TITLE or NAME ?

Best Answer

Thunderbird, as a GTK+ application, supports a --class command-line option that sets the WM_CLASS property:

$thunderbird --class TEST &
$obxprop | grep 'OB_APP'
_OB_APP_TYPE(UTF8_STRING) = "normal"
_OB_APP_TITLE(UTF8_STRING) = "Mozilla Thunderbird"
_OB_APP_GROUP_CLASS(UTF8_STRING) = "TEST"
_OB_APP_GROUP_NAME(UTF8_STRING) = "thunderbird"
_OB_APP_CLASS(UTF8_STRING) = "TEST"
_OB_APP_NAME(UTF8_STRING) = "Mail"
_OB_APP_ROLE(UTF8_STRING) = "3pane"

Openbox supports per-application settings determined by the window class using the class attribute on an <application> entry in rc.xml. You can launch your two copies of Thunderbird with different command-line options and apply your window manager settings by the class you give.

Other GTK+ applications will generally support the same behaviour.

Related Question