Adding new desktop action to Chromium

1

I want to add shortcuts to open Chromium with a specific user profile.

If I type chromium --profile-directory="Default" in a terminal, Chromium opens with the correct profile.

So I tried modifying the chromium.desktop file by adding

Actions=OpenDefault;OpenProfile1;
[Desktop Action OpenDefault]
Name=Open Default profile
Exec=chromium --profile-directory=Default;
[Desktop Action OpenProfile1]
Name=Open Profile 1
Exec=chromium --profile-directory="Profile 1";

This doesn't work. The shortcuts are added to the icon in dash but instead of opening the designated profile, a new profile is created every time. What am I doing wrong?

To Do

Posted 2015-11-22T08:10:08.317

Reputation: 1 772

Answers

0

I think the problem are the semicolons (;) at the end of your Exec lines. If you remove them, it should work.

I have only one Chromium profile so I have slightly changed your example. With the semicolons the (full) .desktop file below didn’t work but without them it works:

[Desktop Entry]
Name=Chromium Test
Exec=chromium-browser
Type=Application
Actions=OpenDefault;OpenProfile1;
[Desktop Action OpenDefault]
Name=Open Default profile
Exec=chromium-browser --profile-directory=Default
[Desktop Action OpenProfile1]
Name=Open in Incognito mode
# Doesn’t work:
#Exec=chromium-browser --incognito;
# Works:
Exec=chromium-browser --incognito

I have tested this under Ubuntu 14.04 with GNOME Shell 3.10.4 and the Quicklists extension (since there is no native jump list support in this GNOME Shell version, yet).

Chriki

Posted 2015-11-22T08:10:08.317

Reputation: 280

Without the semi-colons the desktop actions don't even appear in the context menu. – To Do – 2015-11-22T19:57:48.510

Well, I tried removing the semi-colons and it worked! Don't know what the problem was the first time. – To Do – 2015-11-23T06:54:57.087