OK, I may not understand your objective properly, in which case this may not be of interest, but FWIW, I have 2 profiles ATM. I start both from the Openbox menu with a command like this written directly in the menu file (~/.config/openbox/menu.xml):
Code: Select all
palemoon -P profilename --new-instance
Whether that is equivalent to opening them from a script running in the background, or opening them from a runbox, I don't know. Until I discovered otherwise a few days ago, I assumed those different methods of running a command should produce the same results. Not so. I'm not even sure they are defaulting to bash like all my terminals do. I can't get either the OB menu or the run box to expand $0 to tell me. They may be running commands in dash instead.
If I start a palemoon from the menu and then
Code: Select all
ps -wweo pid,args | grep palemoon | grep -v grep
I get:
Code: Select all
30853 palemoon -P fresh --new-instance
If I start a second instance in the other profile from the menu, the same command now gives me
Code: Select all
16421 palemoon -P default --new-instance
30853 palemoon -P fresh --new-instance
At that point, I can open a new tab with a specified url in either specified window like this:
Code: Select all
palemoon -P fresh --new-tab bitchute.com
or
Code: Select all
palemoon -P default --new-tab minds.com
I double checked in xvt, lxterminal, & grun. They all worked the same way.