Xfce Forum

Sub domains
 

You are not logged in.

#1 2013-02-10 14:33:57

tuxolero
Member
Registered: 2013-02-10
Posts: 25

Can I make session management aware of multiple firefox profiles ?

Hi there,

I am using different firefox profiles for different tasks. One for the day-to-day stuff (in my own private small intranet), one for banking, one for technical forums like this one, one for delvelopment & docs, one for youtube & funstuff etc ...

And I am using manually saved XFCE sessions while having more than one firefox session opened when I save. When I log in next time, I get the same number of profile selector windows instead of the open firefox windows.

I also tried creating multiple starters, one for each profile with -p [profilename] as command line argument. But this way, it tries to start one profile multiple times. Of course, the same profile can not be started multiple times and so, I get one window and some error messages about firefox already being running.

What I would like to achieve is the firefox sessions to be remembered in the session, ideally including the virtual desktop number where they were running at.

Creating a script an put it in autostart has some mayor drawback: I would need to close all firefox windows every time I save the session. Additionally, I would need to adapt this script every time the opened firefox profiles change.

Is there some way to achieve this ?

Thanks and Regards,
Markus

Offline

#2 2013-02-11 20:20:11

jehernan
Member
Registered: 2013-02-08
Posts: 10

Re: Can I make session management aware of multiple firefox profiles ?

Have you tried this firefox addon

https://addons.mozilla.org/en-us/firefo … eswitcher/

this might be a work around for you

Offline

#3 2013-02-11 21:29:31

tuxolero
Member
Registered: 2013-02-10
Posts: 25

Re: Can I make session management aware of multiple firefox profiles ?

Thanks for the hint, I am going to try it.

Offline

#4 2013-02-12 19:55:01

ukbrian
Member
Registered: 2013-02-12
Posts: 2

Re: Can I make session management aware of multiple firefox profiles ?

Might be worth trying

Exec=firefox -P profile-name -no-remote

Offline

#5 2013-02-13 00:03:09

tuxolero
Member
Registered: 2013-02-10
Posts: 25

Re: Can I make session management aware of multiple firefox profiles ?

@jehernan
It makes no difference. Session manager still tries to start the latest selected profile multiple times, failing always except the first try. Being able to switch now still leaves me with manually starting profiles until I have my desktop like it was when I logged off.

@ukbrian
That's exactly what I am doing when working with seperate starters (.desktop files) for each profile. In fact, the -no-remote is necessary for that.

It would be interesting how session manager remembers the state of applications. E.g. the filemanager Thunar opens at the same location. How ist that achieved ?
When it comes to firefox, it even fails to look for command line arguments that are shown in ps.

I just have made a cross-check with another application that depends on command line arguments: meld (a file comparator).
I started two meld sessions with different arguments, then saved the session. Logged off and back on and then I had two meld windows without any arguments.
So, the session manager does neither use the command line args nor does it remember which starter was used to start an application.

So, what does it use with Thunar e.g. ? Is there some specific state save/load protocol for XFCE applications ?

Offline

#6 2013-02-13 14:52:52

jehernan
Member
Registered: 2013-02-08
Posts: 10

Re: Can I make session management aware of multiple firefox profiles ?

@tuxolero   will you post a working example of "creating multiple starters" so we can check the syntax.  also, did you make seperate scripts then call the scripts from xfce or are the starters built into xfce

Offline

#7 2013-02-13 16:00:56

tuxolero
Member
Registered: 2013-02-10
Posts: 25

Re: Can I make session management aware of multiple firefox profiles ?

Yes, of course.

firefox-default.desktop (just removed the internationalized names):

[Desktop Entry]
Version=1.0
Name=Firefox Web Browser
Comment=Browse the World Wide Web
GenericName=Web Browser
Exec=firefox --no-remote -p default
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=firefox
Categories=GNOME;GTK;Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;x-scheme-handler/chrome;video/webm;
StartupWMClass=Firefox
StartupNotify=true
X-Ayatana-Desktop-Shortcuts=NewWindow;

Path=

[NewWindow Shortcut Group]
Name=Open a New Window
Exec=firefox -new-window
TargetEnvironment=Unity

So this is nearly original, except the command line parameters in Exec= ...
Then, I created some copies of this file and changed the -p parameter.

Offline

#8 2013-02-15 15:37:37

jehernan
Member
Registered: 2013-02-08
Posts: 10

Re: Can I make session management aware of multiple firefox profiles ?

What if you made an bash script

#!/bin/bash
/Path/To/firefox --no-remote -P default

save firefox1.sh  make executable chmod +x and rinse and repeat for the other profiles and see if that helps

also, does any know if the p has to be capital

from help

-P <profile>       Start with <profile>.

Offline

#9 2013-02-15 19:58:07

tuxolero
Member
Registered: 2013-02-10
Posts: 25

Re: Can I make session management aware of multiple firefox profiles ?

I also tried bash scripts and used them in the Exec= line. Unfortunately, no difference.

About the capital -P ... firefox can use both variants, -p as well as -P. I just verified that.

I still have the suspission that command line arguments are completely ignored in the saved session. If you look at he program list in the settings (at the place where the "save session" button is), the programs are listed without arguments. OK, this could also mean it's just not showed here, but if you like, you can try the following:

From a terminal, start two meld sessions with different arguments. Something like

meld dir1 dir2 &
meld dir3 dir4 &
ps ax | fgrep meld

Of course, dir1 ... dir4 should exist. I used the "standard" directories for images, videos, documents, and downloads in my home dir, as they were created on user creation and are still empty ...
After checking the output of the ps ax command, you can close the terminal.

With these two meld sessions opened, save the session and log off and back on.

What you get after that is two empty meld windows. if you check again using

ps ax | fgrep meld

you will see that the meld processes have "lost" their command line arguments.

To me, it looks very much like "losing command line arguments" is the problem.

Offline

#10 2013-02-18 15:22:56

jehernan
Member
Registered: 2013-02-08
Posts: 10

Re: Can I make session management aware of multiple firefox profiles ?

that would make sense, i have open terminal in directories i use alot and when i do session save and restore just the terminal without any of the directories, it may be they take a snapshot of what apps are running and they are not parsing the arguments into the session

what if you tried installing individual firefoxs in 4 folders,
http://ubuntuforums.org/showthread.php?t=1907045

then use a startup script similar to the tor bundle
https://www.torproject.org/download/dow … sy.html.en

it has a selfcontained firefox folder

Offline

#11 2013-02-18 22:06:54

tuxolero
Member
Registered: 2013-02-10
Posts: 25

Re: Can I make session management aware of multiple firefox profiles ?

Well, I am not sure about the multiple firefox installations.
I think the problem is that all of them will still look in ~/mozilla/firefox for the profiles. Different executables will not help if they use the same default location for the settings.
Even if there should be a command line argument to specify a different location, the "losing command line arguments" problem will bite me again.

Startup scripts are what I would like to avoid, because I will always need to edit them. This would split my session information into two places. Additionally, I would need to find a way to exclude "firefox" from session management, otherwise firefox will be started through both: the startupscript and the session manager, resulting in even more conflicts. Alternatively, I would need to close all firefox profiles every time before "save session".

I just looked at the startup script in the self-contained tor bundle. The special behaviour of the contained firefox is dependent of being started through the script (e.g. setting $HOME to a different value), otherwise it will use all default values (meaning: ~/.mozilla/firefox).

After my tests with my own one-liner wrapper scripts (just starting firefox with the -p ...) I know that session management does not care if firefox has been started through a script or directly. So, it will start the firefox sessions ignoring any wrapper.

Offline

#12 2013-02-19 16:44:17

jehernan
Member
Registered: 2013-02-08
Posts: 10

Re: Can I make session management aware of multiple firefox profiles ?

well i think we lose for now sad

Offline

#13 2013-02-20 07:40:23

tuxolero
Member
Registered: 2013-02-10
Posts: 25

Re: Can I make session management aware of multiple firefox profiles ?

Yes, but thank you very much for your effort.

Offline

Board footer

Powered by FluxBB