Ubuntu – How to start a separate instance (not profile) of Chromium, with its own icon

chromiumgnome-shell

I want to have two completely different instances of Chromium, each with its own icon, so that:

  1. There are two taskbar buttons, and…
  2. …two entries in the window switcher (Ubuntu 18, GNOME)
  3. They are easily distinguishable by icon/color
  4. I can Alt+Tab between these two instances, and Alt+` (key above Tab) among windows within an instance

How can I do that?

Solutions I've considered:

  1. Different profiles – doesn't satisfy the requirements because all Chromium windows, from all profiles, get lumped under the same taskbar button and window switcher entry.
  2. Install Chrome Beta and Chrome Dev. These aren't exactly Chromium, and I prefer the open source Chrome.
  3. Install Chromium beta/dev. That might work, but the PPA seems maintained by an apparently random developer, who isn't affiliated with Google. If the builds get compromised, the security implications are serious. Also, I prefer the stability of Chromium, and the beta/dev builds tend to be less stable.
  4. I've copied /usr/lib/chromium-browser to /usr/lib/chromium-browser-2 and created a local shortcut ~/.local/share/applications/chromium-browser-2.desktop pointing to it, with a separate icon. That showed a separate icon in the Dash, but when launching it, it opened my existing Chromium profile, and the window still got lumped with the existing Chromium windows. Looks like the executable must be actually different in some way?

Best Answer

What worked (cobbled together from the various answers and comments - thanks!) was to create a .desktop file in ~/.local/share/applications with a few tweaks:

[Desktop Entry]
Version=1.0
Name=Chromium Browser 2
GenericName=Web Browser 2
Comment=Chromium Alternate
Exec=/usr/lib/chromium-browser/chromium-browser --user-data-dir=/home/dandv/Chr2 --class="Chr2"
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=/home/dandv/chromium-browser-2.png
Categories=Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml_xml;x-scheme-handler/http;x-scheme-handler/https;
StartupNotify=true
Actions=NewWindow;Incognito;TempProfile;
X-AppInstall-Package=chromium-browser
StartupWMClass=Chr2

Make sure to replace /home/dandv/ with your home directory. Using ~ did not work.

The tweaks I applied to the .desktop file were:

  1. Add --class="SomethingLikeChr2" to the Exec= line
  2. Add StartupWMClass=SomethingLikeChr2 to the [Desktop Entry] (use the same unique value as above; apparently this is what makes a separate window, that won't get lumped in with existing Chromium windows
  3. Add --user-data-dir=... to the Exec line, due to this Chromium bug.

Result

task switching among two different Chromium instances