For 12.04 / 12.10
I will use the
vim editor, but if you don't know it, feel free to replace
nano (easy terminal editor) or
gedit (gui editor).
You can install
xdotool via the software center: xdotool .
sudo apt-get update && sudo apt-get install xdotool
Creating a custom script to launch nautilus
Create a script with the following content
nautilus $1 && sleep 0.5 ; xdotool key --clearmodifiers F3
and save it somewhere, let's assume we save it as
Make the script executable with
chmod +x ~/scripts/nautilus.bash.
Now test the script, typing
scripts/nautilus.bash should open nautilus, and after a split second you should get your extra pane.
Modifying the desktop file
The desktop file of an application determines how your application will show up in the Unity launcher and dash, and what happens when you click on it.
You can use locate to find out its location
This will return
Now to make sure nothing bad happens let's back it up:
sudo cp /usr/share/applications/nautilus.desktop /usr/share/applications/nautilus.desktop.bak
Now we can safely edit it (remember to use
nano if you don't know
sudo vim /usr/share/applications/nautilus.desktop
Now you will see the following (I removed some content in the middle)
Comment=Access and organize files
[Desktop Action Window]
Name=Open a New Window
We're interested in the
Exec= lines, these lines determine what happens when we click the application. We need to change both (the one under
[Desktop Action Window] is the entry in the Unity quicklist).
nautilus in the
Exec= line by the location of your script, in my case
%U in the top one should stay). Now save and exit.
If you had nautilus locked to your launcher it will have disappeared, search in the Dash for 'Files' and clicking it should open nautilus with an extra pane!
If it works only sometimes (or not at all), maybe increase the time it waits before doing the keypress by increasing the value for the
sleep function in your script.