3

I am using multiple workspaces. Whenever I click the Firefox icon in the Unity toolbar it takes me to the workspace with Firefox currently open which is a useful feature. However, every time I click the Firefox icon I'd like a new window in Firefox to open. I know it's possible to right click the icon and click "Open a New Window" but I'd like "Open a New Window" to be the default.

Here is a terrible hack that I implemented this morning but I'd like to learn a more elegant solution.

First I created a script called openfirefox and placed it in my home directory /home/user

#!/bin/bash

firefox &

I made the file executable and then used the gnome-desktop-item-edit command to create a .desktop file and placed it on the desktop

$ sudo gnome-desktop-item-edit /home/user/Desktop --create-new

I entered the fields as follows

Name: MyFox
Command: /home/user/openfirefox

This created a .desktop file on my desktop. Now whenever I double click the MyFox.desktop file, a new Firefox window opens everytime.

So, is there a more elegant way to do what I want? Perhaps if I edit /usr/share/applications/firefox.desktop I can change the defaults? Maybe there is a Unity setting I can change?

Note: I am also aware you can simply press the shift key to open a new window but I'm just wondering if there is a way to make it a default. If this is an unrealistic request I'll just make do with shift and MyFox.desktop

  • 2
    I think that you can put the .desktop - that you created on your Desktop - in the Launcher. If not, place it in ~/.local/share/applications/ , on the next login it should show up in Unity and then you can put it in the Launcher. – dadexix86 Nov 23 '15 at 17:15
  • This worked. I don't know why I didn't think of this before. Thanks. – CMRELAB Nov 25 '15 at 2:11
  • @CMRELAB You're right. My answer opens a new window whenever the launcher runs the default "Exec" action, but this does not happen when clicking on the icon while it's already running on a different workspace. I deleted my answer. – Byte Commander Nov 26 '15 at 14:18
2

I think that you can put the .desktop file - that you created on your Desktop - in the Launcher.

If not, place it in ~/.local/share/applications/, on the next login it should show up in Unity and then you can put it in the Launcher.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.