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,
Have you tried this firefox addon
this might be a work around for you
Thanks for the hint, I am going to try it.
Might be worth trying
Exec=firefox -P profile-name -no-remote
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.
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 ?
@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
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.
What if you made an bash script
/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
-P <profile> Start with <profile>.
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.
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,
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
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.
well i think we lose for now
Yes, but thank you very much for your effort.