Unity Launcher – Tor-Browser Appears as Firefox

desktopiconslaunchertor-browser

Running Ubuntu 16.04 64-bit, I have installed Tor-Browser from Ubuntu Repository (via terminal). But when I run it, it runs as Firefox. While its icon in dash is its own, when it runs, it shows Firefox icon while switching between windows. On the top panel also it shows Firefox web browser instead of Tor-Browser.

enter image description here

This is the current content of /usr/share/applications/torbrowser.desktop:

[Desktop Entry]
Name=Tor Browser
GenericName=Tor
Comment=Launch Tor Browser
Exec=torbrowser-launcher %u
Terminal=false
Type=Application
Icon=/usr/share/pixmaps/torbrowser.png
Categories=Network;WebBrowser;

(the line related to icon is altered by myself)

If I open a normal Firefox window, both Firefox and Tor-Browser appear under Firefox icon.

Before migrating to 16.04, I didn't have this problem in 15.10 in which I installed Tor-Browser from its website.

Best Answer

The issue is caused by the fact that Tor Browser and Firefox share a string in their WM_CLASSS property:

If you open a terminal, type

xprop WM_CLASS

and click on the window of Firefox, you will get:

WM_CLASS(STRING) = "Navigator", "Firefox"

...and with Tor Browser:

WM_CLASS(STRING) = "Navigator", "Tor Browser"

As a result, the firefox.desktop file (and its icon in Unity/Dash) assumes the Tor Browser window is "his".

How to solve

  • Run the command:

    cp '/usr/share/applications/torbrowser.desktop' ~/.local/share/applications && gedit ~/.local/share/applications/torbrowser.desktop
    

    This will copy the global torbrowser.desktop to ~/.local/share/applications, and subsequently open it with gedit.

  • Now add to the very end of the file the line:

    StartupWMClass=Tor Browser
    

    Save and close the file. This way, the Tor Browser's .deskop file will recognize its own windows.

  • Log out and back in, and it should be fixed.

    enter image description here

Related Question