Wednesday, October 19, 2011

How to Enable Unity Quicklists in Google Chrome and Firefox


Using Google Chrome and/or Chromium:

Google Chrome and Chromium don't support Quicklists by default; however, with a little tweaking the feature can be enabled to support incognito mode. Here's the whole process in 2 easy steps.

Step 1: Backup - Open the terminal (Ctrl+Alt+T) and type in the following code:

sudo cp /usr/share/applications/firefox.desktop /usr/share/applications/firefox.desktop.backup

Step 2: Then, type the following line in the terminal:

sudo gedit /usr/share/applications/google-chrome.desktop

Step 3: Now that the file is opened, paste the following code at the end of the file. When done, press Ctrl+S and close the window.

X-Ayatana-Desktop-Shortcuts=NewWindow;Incognito;

[NewWindow Shortcut Group]

Name=New Window

Exec=google-chrome

TargetEnvironment=Unity

[Incognito Shortcut Group]

Name=New Incognito Tab

Exec=google-chrome --incognito

TargetEnvironment=Unity

When finished, the right-click menu for Chrome will look like this:



Using Firefox:

Firefox 4 can also be tweaked to show various options in the Quicklists. These options allow users to open a new window, toggle the Private browsing mode, start the Profile Manager, and use the safe mode. The safe mode starts Firefox without any extensions orplugins. The profile manager can be used to access different profiles before starting the actual session.

Right-clicking on the Firefox launcher icon and selecting 'Profile Manager' will open a window like this:


Anyways, enough talk, here's how to get it in 4 easy steps:

Step 1: Backup the file..

sudo cp /usr/share/applications/firefox.desktop /usr/share/applications/firefox.desktop.backup

Step 2: Open the terminal and type in..

sudo gedit /usr/share/applications/firefox.desktop

Step 3: Apparently, Firefox already supports the New Window quick list item. So, find the code that begins with a line that looks like this:

X-Ayatana-Desktop-Shortcuts=NewWindow;

This line will be followed by some code. Now, delete the line and the lines below it.

Step 4: Add following code to the file, press Ctrl+S and exit.

X-Ayatana-Desktop-Shortcuts=NewWindow;PrivateToggle;ProfileMgr;Safe-Mode;

[NewWindow Shortcut Group]

Name=Open a New Window

Name[ast]=Abrir una ventana nueva

Name[bn]=Abrir una ventana nueva

Name[ca]=Obre una finestra nova

Name[da]=Åbn et nyt vindue

Name[de]=Ein neues Fenster öffnen

Name[es]=Abrir una ventana nueva

Name[fi]=Avaa uusi ikkuna

Name[fr]=Ouvrir une nouvelle fenêtre

Name[gl]=Abrir unha nova xanela

Name[he]=פתיחת חלון חדש

Name[hr]=Otvori novi prozor

Name[hu]=Új ablak nyitása

Name[it]=Apri una nuova finestra

Name[ja]=新しいウィンドウを開く

Name[ku]=Paceyeke nû veke

Name[lt]=Atverti naują langą

Name[nl]=Nieuw venster openen

Name[ro]=Deschide o fereastră nouă

Name[ru]=Открыть новое окно

Name[sv]=Öppna ett nytt fönster

Name[ug]=يېڭى كۆزنەك ئېچىش

Name[uk]=Відкрити нове вікно

Name[zh_CN]=新建窗口

Name[zh_TW]=開啟新視窗

Exec=firefox -new-window about:blank

TargetEnvironment=Unity

[Safe-Mode Shortcut Group]

Name=Safe-Mode

Exec=firefox -safe-mode

TargetEnvironment=Unity

[PrivateToggle Shortcut Group]

Name=Enable/Disabe Private Mode

Exec=firefox -private-toggle

TargetEnvironment=Unity

[ProfileMgr Shortcut Group]

Name=Start Profile Manager

Exec=firefox -ProfileManager

TargetEnvironment=Unity

Finally, if all goes well, the menu will look like this:


Menu doesn't show up:
If the menu doesn't show up, remove the launcher from the Unity bar by right-clicking and unchecking the option titled “Keep in Launcher”. Then search for the program and drag it to the Unity bar again. The Quicklist should be visible by now.

If something goes wrong, type the following commands. These commands will restore the original ‘.desktop’ files and delete the modified ones, taking things back to normal.

For Google Chrome:
sudo rm -rf /usr/share/applications/google-chrome.desktop
sudo mv /usr/share/applications/google-chrome.desktop.backup /usr/share/applications/google-chrome.desktop

For Firefox:
sudo rm -rf /usr/share/applications/firefox.desktop
sudo mv /usr/share/applications/firefox.desktop.backup /usr/share/applications/firefox.desktop