Changing profile directory

Users and developers helping users with generic and technical Pale Moon issues on all operating systems.

Moderator: trava90

Forum rules
This board is for technical/general usage questions and troubleshooting for the Pale Moon browser only.
Technical issues and questions not related to the Pale Moon browser should be posted in other boards!
Please keep off-topic and general discussion out of this board, thank you!
User avatar
gracious1
Keeps coming back
Keeps coming back
Posts: 891
Joined: 2016-05-15, 05:00
Location: humid upstate NY

Changing profile directory

Unread post by gracious1 » 2017-10-21, 13:47

This is a question not about how to create new profiles and switch between profiles. Rather, what I would like to know is how to get Pale Moon to open profiles located in a different directory, and only that directory.

I have both stable and unstable versions of Pale Moon installed (in /usr/lib and /opt, respectively). I have things set so that when I run either one, the Profile Manager is automatically invoked so that I may select the right profile. Both versions can see all the profiles in ~/.moonchild productions/pale moon. What I would like to do, however, is to have the unstable version open profiles in a different directory, namely ~/.moonchild productions/pm-unstable.

Is this possible? :eh:

I searched for an answer on this forum, and found threads like [Solved]How To Create A New Profile In Linux Pale Moon — which gave me a lot of insight into profiles.ini and how to hack it if for some reason I didn't want to use the Profile Manager :mrgreen: , but it doesn't tell me exactly what I want to know.

So, I can create a new profile in a different directory, which I did with unstable PM and uncreatively called NewProfile. But then unstable PM can still see all my other profiles, and stable PM can see NewProfile in the other directory (~/.moonchild productions/pm-unstable).

Is there a way to make it so that they can only see one or the other directory? I want the stable release to see only what is in ~/.moonchild productions/pale moon and the unstable version to see only what it is in ~/.moonchild productions/pm-unstable . Is this doable?

Thanks. :geek:
20 July 1969 🌗 Apollo 11 🌓 "One small step for [a] man, one giant leap for mankind." 🚀

Walter Dnes
Astronaut
Astronaut
Posts: 650
Joined: 2015-07-30, 20:29
Location: Vaughan, ON, Canada

Re: Changing profile directory

Unread post by Walter Dnes » 2017-10-21, 19:00

Short of tweaking the source code or the build you cannot change the fact that it looks for its profile in

Code: Select all

$HOME/.moonchild productions/pale moon
But you can easily tweak the $HOME variable. Here's the setup
  1. mkdir $HOME/exp (This creates a pseudo-HOME dir fpr the test version)
    create a bash script named "pmt" in your path with the following commands. Replace "path-to-test-version-palemoon" with the actual path

    Code: Select all

    #!/bin/bash
    HOME="${HOME}/exp"
    path-to-test-version-palemoon -new-instance -p "${1}"
    launch with the command pmt or pmt profilename
    Profiles will go into $HOME/exp/,moonchild productions
If you select a non-existant profile, you'll end up in the profile-manager dialogue. Be careful not to accept
Default User as a profile name. Launching it with the script would require exact matching upper/lowercase and escaping the embedded space. Keep all profile names as one word, all lowercase.
There's a right way
There's a wrong way
And then there's my way

User avatar
gracious1
Keeps coming back
Keeps coming back
Posts: 891
Joined: 2016-05-15, 05:00
Location: humid upstate NY

Re: Changing profile directory

Unread post by gracious1 » 2017-10-22, 03:50

Thanks, Watler Dnes! I just have a couple of questions before I start.
Walter Dnes wrote:

Code: Select all

#!/bin/bash
HOME="${HOME}/exp"
path-to-test-version-palemoon -new-instance -p "${1}"
Is there a reason to prefer --new-instance over --no-remote ? I have modified my pm-unstable.desktop launcher, for example, to this:

Code: Select all

Exec=/opt/palemoon-unstable/palemoon -P --no-remote
Should I have used --new-instance instead?

WalterDnes wrote:Keep all profile names as one word, all lowercase.
I never use spaces in names in Linux or UNIX if I can help it. Causes all sorts of headaches. :coffee: :sick:

But as for all lowercase, I assume you are suggesting this as best practice to prevent typos? I have some profiles named with all caps (e.g. SEPTIMUS) and some with mixed (e.g. Saratoga), and so far I have not had any problems. I have no problems remembering when writing scripts, aliases, etc. that it's "SEPTIMUS" and not "septimus" or "Septimus".
20 July 1969 🌗 Apollo 11 🌓 "One small step for [a] man, one giant leap for mankind." 🚀

Walter Dnes
Astronaut
Astronaut
Posts: 650
Joined: 2015-07-30, 20:29
Location: Vaughan, ON, Canada

Re: Changing profile directory

Unread post by Walter Dnes » 2017-10-22, 09:19

gracious1 wrote:Is there a reason to prefer --new-instance over --no-remote ? I have modified my pm-unstable.desktop launcher, for example, to this:

Code: Select all

Exec=/opt/palemoon-unstable/palemoon -P --no-remote
Should I have used --new-instance instead?
They're the same according to palemoon --help. "--new-instance" was more explicit for what I wanted when I set up my program launcher. Whatever works for you.

Code: Select all

  --no-remote                         Do not accept or send remote commands; implies --new-instance.
  --new-instance                      Open new instance, not a new window in running instance.
gracious1 wrote:But as for all lowercase, I assume you are suggesting this as best practice to prevent typos? I have some profiles named with all caps (e.g. SEPTIMUS) and some with mixed (e.g. Saratoga), and so far I have not had any problems. I have no problems remembering when writing scripts, aliases, etc. that it's "SEPTIMUS" and not "septimus" or "Septimus".
That's correct. I prefer to avoid moving around the keyboard to get at the {SHIFT} key, let alone remembering which characters to uppercase.
There's a right way
There's a wrong way
And then there's my way

User avatar
gracious1
Keeps coming back
Keeps coming back
Posts: 891
Joined: 2016-05-15, 05:00
Location: humid upstate NY

Re: Changing profile directory

Unread post by gracious1 » 2017-10-22, 23:29

Thanks. I have another question. Is there a way to use the browser UI to migrate selected profiles from the original directory to my new experimental directory?

Otherwise, I can see only moving (well, actually copying) profile folders...

Code: Select all

cd ~/.moon*/pale*
cp profile1 profile2 profile3 ~/exp/.moon*/pale*
... and then editing the new profiles.ini using the original profiles.ini as a template.
(I already created a profiles.ini in the experimental directory when I tested the script you gave me before.)

Seems like much of this could be a script somehow..... :think: (I'd need help with that!)

Then I would have to be sure use Profile Manager in the stable Pale Moon to remove the profiles from the original directory. (Better 'cp' than 'mv' because then I would have to edit the original profiles.ini. Probably the less manual editing the better. :shifty: )

But actually, I am sure there is a way to import the profiles directly? :geek:
20 July 1969 🌗 Apollo 11 🌓 "One small step for [a] man, one giant leap for mankind." 🚀

Walter Dnes
Astronaut
Astronaut
Posts: 650
Joined: 2015-07-30, 20:29
Location: Vaughan, ON, Canada

Re: Changing profile directory

Unread post by Walter Dnes » 2017-10-22, 23:37

See post https://forum.palemoon.org/viewtopic.php?f=37&t=15728#p114266 for detailed instructions on how to do "brain surgery" on Pale Moon profiles on linux.
There's a right way
There's a wrong way
And then there's my way

User avatar
adesh
Board Warrior
Board Warrior
Posts: 1277
Joined: 2017-06-06, 07:38

Re: Changing profile directory

Unread post by adesh » 2017-11-11, 14:08

This thread has gone silent, but the best (opinion) solution has not come yet. So, here it is - use --profile switch with a path.

Code: Select all

palemoon --no-remote --profile /media/my_usb_drive/top_secret_profile

Code: Select all

mkdir /tmp/test
palemoon --no-remote --profile /tmp/test
Please note that for this to work, the given path must exist. After launch, if the directory is pristine, it will be populated properly by the browser. Using this method, profile directory will also serve as the cache directory, i.e. you will see "cache2" folder inside it.

User avatar
gracious1
Keeps coming back
Keeps coming back
Posts: 891
Joined: 2016-05-15, 05:00
Location: humid upstate NY

Re: Changing profile directory

Unread post by gracious1 » 2017-11-11, 23:59

adesh wrote:This thread has gone silent, but the best (opinion) solution has not come yet.
It went silent, I suppose, because I didn't respond to the previous solution after using it in practice for a while. What happened when I used it is that I discovered an effect that was less desirable. Once you've created a new $HOME directory, there are consequences, such as, for example, "bookmarked" places broken, having to re-create paths to directories Downloads, Pictures, and other issues that arose. So when I began to use it, it became very complicated. So I sort of put the whole project on hold.

I think this profile switch is more what I was looking for. We'll see how it goes. ;)
20 July 1969 🌗 Apollo 11 🌓 "One small step for [a] man, one giant leap for mankind." 🚀

Locked