Bolt icon indicating copy to clipboard operation
Bolt copied to clipboard

Bolt launcher using a different firefox profile

Open rompetomp opened this issue 1 year ago • 2 comments

Whenever I launch Runelite through Bolt Launcher (arch linux, no flatpak), and I open a webbrowser through it (to login to RuneLite, or click the wiki picker thingy), it opens Firefox in a new profile. This is because the .mozilla folder with all the profiles is under the home folder of the user.

Bolt sets the user_home to ~/.local/share/bolt-launcher, which makes firefox create a new profile under ~/.local/share/bolt-launcher/.mozilla.

This doesn't seem to be an issue with Chromium browsers as they store their application data in XDG_CONFIG_HOME.

rompetomp avatar Nov 22 '24 08:11 rompetomp

Yes, Firefox doesn't respect XDG base directories. This has been on mozilla's issue tracker for over 20 years. In the meantime, just symlink .mozilla to your home directory.

Adamcake avatar Nov 22 '24 14:11 Adamcake

The problem with linking the Bolt .mozzila with the home directories is that if firefox already had a running instance, it wouldn't launch due to the profile lock. "Firefox is already running, but is not responding. To use Firefox, you must first close the existing Firefox process, restart your device, or use a different profile." Any solutions how to circumvent this?

Silgrond avatar Apr 28 '25 05:04 Silgrond

If Firefox thinks that Firefox is not responding, that sounds like an issue with your setup? Are you sure you symlinked it correctly?

Adamcake avatar Jun 27 '25 14:06 Adamcake

This happens on my machine too. Just wondering if I'm symlinking in the correct dir:

~/.local/share/bolt-launcher ❯ ls -la
total 2406
drwxr-xr-x  8 user user      12 Jun 28 13:31 .
drwx------ 79 user user      90 Jun 28 19:08 ..
drwxr-xr-x 43 user user      65 Jun 28 17:56 CefCache
-rw-r--r--  1 user user    2313 Jun 28 17:55 creds
drwxr-xr-x  2 user user       2 Jun 28 13:28 Documents
drwxr-xr-x  2 user user       2 Jun 28 13:25 Downloads
drwxr-xr-x  3 user user       3 Jun 28 13:25 .java
drwxr-xr-x  3 user user       3 Jun 28 13:25 .local
lrwxrwxrwx  1 user user      19 Jun 28 13:31 .mozilla -> /home/user/.mozilla
drwxr-xr-x 15 user user      19 Jun 28 13:27 .runelite
-rw-r--r--  1 user user       9 Jun 28 13:25 runelite_id.bin
-rwxr-xr-x  1 user user 2500882 Jun 28 13:25 runelite.jar

Any action that launches the browser raises:

Image

EDIT:

With a little digging, I've tracked it down to the changing of HOME:

sz ~ ❯ mkdir test 
sz ~ ❯ cd test
sz ~/test ❯ ln -s /home/user/.mozilla .mozilla
sz ~/test ❯ export HOME=$PWD
sz ~ ❯ /usr/bin/env xdg-open https://google.com

This will raise the same error. I'm not sure if this is an issue with Bolt or with Firefox. Is there a reason HOME is changed?

115100 avatar Jun 28 '25 18:06 115100

$HOME is changed for game processes to make sure they put their data (e.g. .runelite) in an xdg-appropriate location instead of dumping it in the home directory. All the games and clients need this for some reason or another. But that's why I suggest the symlink.

It's unusual that you'd have Documents, Downloads and .local in that directory?

Is /home/user actually the correct path? Or did you not want to post your actual username? (Fine if so, just making sure you have the right path)

Adamcake avatar Jun 28 '25 20:06 Adamcake

Yes, my home is the correct path. Those directories were created by Firefox. I don't think there's much to do here as FF doesn't handle this very well.

115100 avatar Jun 28 '25 20:06 115100

Sorry this took so long, a workaround I found in the firefox source code is to set XRE_PROFILE_PATH in your environment. For example for me it would be XRE_PROFILE_PATH=/home/adam/.librewolf/p60qo4na.default-release/. (I use librewolf but exactly the same fix should work for .mozilla)

If you want to set this for bolt only, use a custom launch command in the settings: /usr/bin/env XRE_PROFILE_PATH=... %command%

Adamcake avatar Jul 23 '25 14:07 Adamcake

Great, that works!

I've seen that there's progress on the filed Bugzilla issue too and there's one PR left for approval before FF gets XDG env var support: https://phabricator.services.mozilla.com/D6995

That should hopefully be a more permanent solution that doesn't hardcode profile paths.

115100 avatar Jul 23 '25 14:07 115100

The original issue has been open for 21 years https://bugzilla.mozilla.org/show_bug.cgi?id=259356, so I'll believe it when I see it, but yeah, fingers crossed.

Anyway - closed with workaround.

Adamcake avatar Jul 23 '25 14:07 Adamcake