jump to navigation

Browser profiles in Chromium May 17, 2010

Posted by jdstrand in ubuntu.
trackback

A coworker turned me onto browser profiles in Firefox (thanks Kees!). Browser profiles are a great way to keep your passwords, bookmarks, preferences and even extensions separate. I like to use one for work and one for personal stuff (and a few others). For more information on how to use them in Firefox, see http://support.mozilla.com/en-US/kb/profiles.

I started playing with Chromium lately, and found that it also supports profiles (see http://www.chromium.org/user-experience/user-data-directory), but not quite as conveniently as Firefox. With Firefox, you can launch it like so:

$ firefox -ProfileManager -no-remote
and get a nice little dialog. Well, I wanted the same in Chromium, so I hacked up this little script which achieves the same:

#!/bin/sh
set -e
  
topdir="$HOME/.config/chromium"
profiles="True Default"
for d in `find -H $topdir -maxdepth 1 -mindepth 1 -type d` ; do
  if [ "$d" != "$topdir/Default" ] && [ "$d" != "$topdir/Dictionaries" ]; then
    profiles="$profiles False `basename $d`"
  fi
done
  
if ans=`zenity --title "Chromium profile chooser" --text "Choose a profile from the list below:" --list --radiolist --column "Profile" --column "Item" $profiles` ; then
  if [ "$ans" = "Default" ]; then
    chromium-browser $@
  else
    chromium-browser --user-data-dir="$topdir/$ans" $@
  fi
else
  echo "Aborted"
fi

I saved this as $HOME/bin/chromium-launcher.sh then created a launcher in Gnome using:

/home/<my username>/bin/chromium-launcher.sh %u

This should pick up new profiles as you add them and also works the first time you launch Chromium. Enjoy!

Comments»

1. Juan - May 17, 2010

I think you also need to pass –enable-udd-profiles to chromium-browser

jdstrand - May 18, 2010

I could not find documentation on –enable-udd-profiles in –help, the man page or the google documentation. Where did you find it? I should mention I am using chromium 5.0.342.9~r43360-0ubuntu2 on Ubuntu 10.04 LTS.

jdstrand - May 18, 2010

A fellow Ubuntu developer (fta) looked into –enable-udd-profiles and told me that it is supposed to trigger ShowSelectProfileDialog(), but on the Linux port triggers NOTIMPLEMENTED() ever since http://codereview.chromium.org/254007 landed.

Thanks fta! :)

roy_hu - May 20, 2010

You’re basically correct in the other reply (which I couldn’t reply to). –enable-udd-profiles just enables a keybinding Ctrl-M on Windows for quick profile switching. –user-data-dir is always supported no matter what, although a bit clumsy.

You better refer to the code for the entire set of options. See chrome/common/chrome_switches.cc.

2. Aoirthoir An Broc - May 18, 2010

I modified it a bit to work with Google Chrome and it’s splendid. Some time I will check out Chromium and see if the difference is worth running and installing it. Thanks for the script, got to learn something about zenity also.

3. Aoirthoir An Broc - May 20, 2010

roy_hu, I’ve been using –user-data-dir for a few weeks (even prior to the ability in this post to switch based on a popup) and it’s not been clumsy at all for me.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: