I am using a dual screen setup. Ubuntu 14.10/Unity. Each screen has its own launcher/Dash. Default applictions like Firefox, nautilus, terminal & thunderbird appears on the screen where I have used the launcher. So..when I use the launcher for Firefox on the right screen, the browser opens on the right side screen. As it should be.
I would like that behavior with other application like Google Chrome. I can't seem to find a proper solution.
Best Answer
Redirecting the command to run an application
Most applications open their window on the screen they were initiated from (either from Dash or the launcher). Some applications however do not, but they can be forced to, by redirecting the command to run the application through the script below. To do that, you will need to edit the corresponding
.desktop
file (launcher).The setup seems a bit complicated, but if the procedure is followed ("How to use"), it should not be too difficult at all.
How it works
Issue / solution
There is one downside: if you replace the
.desktop
file's main command by the command to call this script, the right-click "open with " will not work properly. In the case of a webbrowser like Google Chrome, that will not be too big a problem. With other applications, a simple solution would be to add the option to open a new window on the current screen as a shortcut (see further below).How to use:
The script uses both
wmctrl
andxautomation
:Create a directory
~/bin
if it does not exist yet.Copy the script into an empty file, save it as
open_oncurrent
(no extension) in~/bin
Copy the corresponding
.desktop
file from/usr/share/applications
to~/.local/share/applications
:Open the local copy in
~/.local/share/applications
:Edit the file (two options):
To change the main command of the launcher:
find the line:
change it to
To add the option as a shortcut (like in the image above):
find the line:
replace it by:
Then add the following section to the very end of the file:
How to use with other applications:
Similarly, you can apply the solution to other applications. The syntax of the command to use in the
.desktop
fileis like the example:A small additional explanation on how to deal with exceptions is in the script.
The script