0

On Windows, I could install two different instances of Firefox linked to two different profiles. There were two icons on the desktop and on the start menu to see which one is which.

I just migrated my computer on Ubuntu 18.04 LTS with i3-wm and I use rofi as menu.

I would like to know if it's possible to launch two different profiles of Firefox using rofi and assign each profile on a different workspace.

For example: If I have Firefox-A and Firefox-B as profiles, I would like to being able to launch Firefox-B on workspace 2 just by launching it from rofi. If I launch Firefox-A, it should open on workspace 1.

Thank you very much.

Pilot6
  • 90,100
  • 91
  • 213
  • 324
Bravo2bad
  • 327
  • 1
  • To put firefox on specific workspace use assign in i3 config file to automatically put them in specific workspace - see more here : https://i3wm.org/docs/userguide.html . You can also use append_layout. – Michal Przybylowicz Feb 09 '20 at 11:52
  • Thank you for your answers but I already know how to use different profiles with Firefox and how to assign a program to a specific workspace in i3-wm. I would like to know if it's possible to launch a specific profile from rofi and assign a specific profile to a specific workspace. – Bravo2bad Feb 13 '20 at 21:22

1 Answers1

1

First, locate firefox location on your machine with:

$ which firefox
/usr/bin/firefox

Then you could create two scripts looking like:

#!/usr/bin/env bash

/usr/bin/firefox -P profileA
#!/usr/bin/env bash

/usr/bin/firefox -P profileB

And make them executable: chmod +x firefox-A firefox-B

Then, you just have to put those files somewhere in your PATH (~/.local/bin, or /usr/bin), rofi/dmenu will automatically find them and show them as any other binaries.

If you need specific assignation of each profile into each workspace in i3, you may want to set specific class for each profile like so:

#!/usr/bin/env bash

/usr/bin/firefox -P profileA --no-remote --class firefoxA
#!/usr/bin/env bash

/usr/bin/firefox -P profileA --no-remote --class firefoxA

and then, into your i3 configuration you will have something like:

for_window [class="firefoxA"] move to workspace (your workspace number)
avallete
  • 169
  • rofi did find the bin files but I got an error: Error: 'Failed to execute child process "Firefox-A" (No such file or directory)'

    By the way, is there a way to launch Firefox-A profile on workspace 1 for example and Firefox-2 on workspace 2 ? Because when I use xprop, they both have the same WM_CLASS value and both profiles launch on the same workspace.

    – Bravo2bad Feb 13 '20 at 21:39
  • 1
    Look like rofi cannot find some file. Please check that the path of firefox into the script is the same on your machine. I've updated my answer to give more details on how to locate firefox path, and how to assign specific class at each profile as well. – avallete Feb 14 '20 at 00:03
  • Perfect, exactly what I was looking for. Thank you. – Bravo2bad Feb 22 '20 at 11:53