4

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 ?

3

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.

  • that works perfectly. Now I have noticed, Thunderbird is being executed as Exec=icedove %u. Do you have any idea what the %u means? – Martin Vegter Jul 11 '14 at 10:21
  • %u is replaced with "a single URL" in the command line if you drag something onto the launcher icon. – Michael Homer Jul 11 '14 at 10:25
  • @Michael Homer - so where should I put the class, infront or after %u?,i.e. icedove --class TEST %u, or icedove %u --class TEST? – user1968963 Jul 11 '14 at 10:31
  • thunderbird --help suggests options go before the URL parameter. – Michael Homer Jul 11 '14 at 10:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.