Can I put two chrome (different users) on my launcher?
Solution 1
It is quite simple to do this in Windows but not the same in Ubuntu.
For Ubuntu, I found two ways. Personally I recommend method 2 because you don't need to install anything. It also allows you to access the second profile from "Activities" (Ubuntu) without using any commands.
Please note that either way you choose, you have to know YOUR_PROFILE_NAME
.
YOUR_PROFILE_NAME
is normally Default
for the first profile you created. The second profile is named Profile\ 1
. The third is Profile\ 2
, and so on (You can also give custom names for profiles). You can identify which profile is currently loaded by opening chrome://version
inside Chrome and looking at Profile Path
.
-
Follow Filippo's answer but change the
Command
to:google-chrome --profile-directory=YOUR_PROFILE_NAME
-
Put this code in any text editor and name it anything
.desktop
.#!/usr/bin/env xdg-open [Desktop Entry] Version=1.0 Type=Application Terminal=false Icon[en_US]=google-chrome Exec=google-chrome --profile-directory=YOUR_PROFILE_NAME Name[en_US]=Chrome-YOUR_PROFILE_NAME Name=Chrome-YOUR_PROFILE_NAME Icon=google-chrome
Right-click the file. Open "Properties". Go to "Permissions" tab. Click Allow executing file as program.
You can keep the
.desktop
file in~/.local/share/applications/
so that your Application Launcher can locate it easily. Now simply press super and search forChrome-YOUR_PROFILE_NAME
(value given forName
), you will find the second profile appearing in the search results!
Solution 2
This is what I did to achieve the same thing:
sudo apt-get install gnome-panel
gnome-desktop-item-edit ~/Desktop/ --create-new
to create the first "Application Launcher" with the Command
:
google-chrome --user-data-dir=/home/XXXXX/.config/google-chrome/Profile\ 1
Then drag the icon created from the desktop to the launcher. Repeat for the Profile 2
.
Solution 3
All the other answers have a caveat: the shortcut will open tabs or new windows and group them with the official Google Chrome shortcut.
I wanted to make the new shortcut to open windows in its own icon, so I can place both icons in my dock and easily switch between the different Chromes.
I discovered that you basically need to use the flags --class
and --user-data-dir
to Chrome's executable.
So I wrote a script to make this automatically and if you want to try (don't worry, it won't perform any action before you confirm -- unless you use --force
), just run:
bash -c "$(curl -fsSL "https://raw.githubusercontent.com/felipecassiors/dotfiles/master/scripts/create_alternative_chrome_shortcut.sh")"
If you want to know more about it, take a look here.
The only caveat is that since it uses --user-data-dir
instead of --profile-directory
, the new Chrome instance will act like a fresh new. This is needed because of this bug.
In the end, you'll end up with something like this:
[
Solution 4
Edit the main shortcut file:
/usr/share/applications/google-chrome.desktop
The section [Desktop Entry]
find the option Actions=
and add your new action (use semi-colon to separate and at the end):
Actions=new-window;new-private-window;new-window-myprofile;
Create a new section with the same name given on the action above.
The Name
is the submenu item that will be shown.
The "Profile 1"
must be the same as you get on the chrome://version/
(use it on the URL using the desired profile to configure) in the line Profile Path.
[Desktop Action new-window-myprofile]
Name=New Window as MyProfile
Exec=/usr/bin/google-chrome-stable %U --profile-directory="Profile 1"
On my example "as Zoop" is the Profile 1
and "as Renan" is the Profile 2
Related videos on Youtube
humungs
Updated on September 18, 2022Comments
-
humungs over 1 year
On Windows, Google Chrome has the option to create a shortcut on the desktop for each Chrome user. For example, I have my personal Google Account and I also have my company Google Account. So, I setup Google Chrome with two users and I created two shortcuts on desktop for each user.
On Ubuntu, I also created two users and I setup my accounts. But I can't create two "shortcuts" on launcher for each user. Is that possible? Today, on Ubuntu, I have to change between the users directly on chrome. I am not complaining about this, but I am used to have more chrome shortcuts.
I can also get used in Ubuntu is this is not possible.
My versions:
- Ubuntu 14.04 LTS
- Chrome 35.0.1916.153
-
Admin almost 10 yearsThis page may have to command you need. If so, you you can then edit the .desktop files. peter.sh/experiments/chromium-command-line-switches
-
Admin almost 10 yearsIMHO, you should complain, and that loudly, at the Chrome support forums. Programs can and do create desktop shortcuts, so it is odd that Chrome doesn't ask.
-
Admin about 4 yearsAnother easy option is installing chrome beta channel for personal account (sudo apt install google-chrome-beta). Should be relatively safe to use.
-
humungs almost 10 yearsI did exactly what you said. The shortcut is created, but when I open Google Chrome is look like a new installation asking if I want to set Chrome as default browser. My command:
google-chrome --user-data-dir=/home/rgiaviti/.config/google-chrome/Profile\ 1
. I double checked the path and it's OK. -
Marecky about 7 years@RicardoGiaviti don't use
--user-data-dir=...
instead use--profile-directory=Profile\ 1
or--profile-directory=Default
-
Tiziano S. over 5 yearsThanks for the good answer, I suppose this still work year and a half later. How could one figure out what the profiles are named, exactly? Are there any available commands or paths to check? And if so, please add this to the answer as it would be super handy to know this. Thank you
-
Anshuman Kumar over 3 yearsHi, it doesn't appear to work.
-
felipecrs over 3 years@AnshumanKumar I just tested here and it's working, Pop!_OS 20.04.
-
Seff about 3 yearsThis works, but the changes will be gone when the package updates.
-
mchid about 3 years@Denny
cat ~/.config/google-chrome/Local\ State | jq .profile
should list all the profiles. If you have more than one, it should be "Default", "Profile 1", "Profile 2" . . . and so on and so forth. -
masterfloda about 3 yearsExactly what I was looking for, thank you! Although you shouldn't ask people to just run a bash script from the internet. Yours is harmless, but others might be malicious.
-
Jander about 2 years@Seff Add a copy of this
.desktop
to~/.local/share/applications/
and edit this copy. -
Admin almost 2 yearsSolution is almost perfect but I have one issue. Right now all commands that would open a browser (i.e.
gcloud auth login
) open tab in the default Chrome withoutuser-data-dir
... is there a way to somehow adjust it?