Ask Ubuntu Asked by humungs on November 18, 2021
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:
Example: Create a directory called in-softs
in the home
directory.
Create a directory called uv
in the that in-softs
directory.
MyChrome.desktop
on the desktop and copy following content into that file.[Desktop Entry]
Version=1.0
Name=google-chrome
# Only KDE 4 seems to use GenericName, so we reuse the KDE strings.
# From Ubuntu's language-pack-kde-XX-base packages, version 9.04-20090413.
GenericName=Web Browser
# Gnome and KDE 3 uses Comment.
Comment=Access the Internet
Exec=/usr/bin/google-chrome-stable %U --user-data-dir=/home/yuvraj/in-softs/chrome-uv
StartupNotify=true
Terminal=false
Icon=help-about
Type=Application
Categories=Network;WebBrowser;
MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/ftp;x-scheme-handler/http;x-scheme-handler/https;
Actions=new-window;new-private-window;
[Desktop Action new-window]
Name=New Window
Exec=/usr/bin/google-chrome-stable --user-data-dir=/home/yuvraj/in-softs/chrome-uv
[Desktop Action new-private-window]
Name=New Incognito Window
Exec=/usr/bin/google-chrome-stable --incognito --user-data-dir=/home/yuvraj/in-softs/chrome-uv
uv
We can create multiple user data profiles using this approach.
Note: : This approach is tested on Ubuntu 20.04 LTS
Answered by Yuvraj Patil on November 18, 2021
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:
[
Answered by felipecrs on November 18, 2021
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
Answered by Renan Benedicto Pereira on November 18, 2021
Here's how I did it in Linux Mint, which is based on Ubuntu:
Install Chrome by whatever guide you'd like to follow. If it's already installed, that's fine.
Once Chrome is installed, copy the Chrome launcher icon to the desktop by right-clicking the Chrome icon in the 'start' menu and then selecting 'Add to Desktop"
Since you want at least two Chrome profiles that can run at the same time, duplicate the new desktop launcher icon again to create two launchers. Do this by simply right clicking the new Chrome launcher/icon on the desktop. Right click and click copy. Then moving your mouse over to a blank area of the desktop and click paste. You now have at least two Crhome icons on your desktop.
Create two folders/directories in mint. I created. /home/mint/Sync/1/ /home/mint/Sync/2/
Right click on the first icon and click Properties Edit the launcher tab to say:
/usr/bin/google-chrome-stable --user-data-dir=/home/mint/Sync/.config/google-chrome/Profile 1
Repeat the process and edit the second icon's launcher tab to say:
/usr/bin/google-chrome-stable --user-data-dir=/home/mint/Sync/.config/google-chrome/Profile 2
You'll want to rename each launcher/icon so you know which profile you're going to open up when you double click on it. Since one is for work and one is for home, I named them, very creatively, Chrome Work and Chrome Home. I renamed them by right clicking on each launcher icon and then clicking 'Rename'. You can also do this in the General tab on Mint when you are in there creating your profile on the Launcher tab.
One person replied that it looked like a whole new fresh install of Chrome, because he was missing his customizations (American spelling), I imagine. It seemed to confuse him, but that is because the original profile was stored in the default location and now the new profile folder/directory is blank. Since I already had Chrome installed, and a profile was saved to the default location (/home/mint/.config/google-chrome/Default), I deleted everything out of the default location. I then created my separate profile folder location and created the corresponding profiles as laid out above. Then I signed into each with different accounts.
This is my preferred method of using multiple profiles on Chrome, because I have to do no account switching, not adding of accounts. Each operate as if they were separately installed instances of Chrome - like you had Chrome on your system twice. You can also do this with portable versions of Chrome on Windows, Linux and I bet on on Mac. Problem is, you can't easily update a portable version of Chrome, at least not the ones I've used.
There is a very similar method to create multiple profiles on Windows. I found it only once years ago and I thank goodness I saved my notes. It also involves setting up multiple launcher icons on the desktop, or wherever you'd like, going into the properties on those icons and directing Chrome to put the profile information in locations you specify. The '--user-data-dir=' in the run command is the same in both Windows and Linux. I can't speak to Mac, but since BSD (Mac) and Linux are far more similar than not, in my uneducated opinion, I wager it works the same.
I really hope that helps, because I hate combing through forums and not finding what I want. I hope I've been thorough enough, because I hate even worse finding what I need, and the person who posted gives maybe three words, and the first always starts with 'just'.
Answered by Self-entitled-Idiot on November 18, 2021
Create your chrome profile folder. (You may also place them elsewhere, and ln -s
them to here)
cd ~/.config/google-chrome
mkdir chrome-foo
create a start file in /usr/bin
:
sudo touch /usr/bin/chrome-foo
sudo pluma /usr/bin/chrome-foo
in pluma
(or geany
or nano
or vi
...)
#!/usr/bin/env bash
google-chrome --profile-directory=chrome-foo & disown
(personally, I'd chuck in a --disable-session-crashed-bubble
, too)
and enable it for execution by regular users:
sudo chmod +x /usr/bin/chrome-foo
Now you can create a link to the start file:
You can click on the icon to change that.
... or also conveniently call the different flavors from command line:
$> chrome-foo
I personally have chrome-priv
, chrome-work
, chrome-dev
and chrome-family
to have the proper bookmarks and logins seperate, etc.
Answered by Frank Nocke on November 18, 2021
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 for Chrome-YOUR_PROFILE_NAME
(value given for Name
), you will find the second profile appearing in the search results!
Answered by Wit on November 18, 2021
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
.
Answered by Filippo Vitale on November 18, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP