Comment 15 for bug 1103593

Revision history for this message
JHosier (jhosier) wrote :

Dear Fellow Annoyed Ubuntu Users :-)
After giving up checking on this thread for some months, assuming that it would never get fixed, I checked it again this morning.
After reading the comment above from dafreez I tested it and it nearly worked. Thank you for the suggestion dafreez.
This is what I found after testing the suggested script.
It seems as though the gsettings command needs to be run as the user which is logged on.
If it is run as root it does not work when you login as yourself.
Also the crontab suggestion did not work for me. The command @reboot did nothing for me.

However, after a bit of tweaking I got a workable solution that is OK for me.
I followed the first part of the suggestion and created a file in my home area called /home/jhosier/stop-network-mounts-unity
In the file I placed the lines as above, namely:

#!/bin/bash
echo stop-network-mounts-unity running > /home/jhosier/test.txt
while [ 1 ]
do
 gsettings set com.canonical.Unity.Devices blacklist "['-']"
 sleep 1
done

Then in order to make it run when I login I created a file named /home/jhosier/.config/autostart/stop-network-mounts-unity.desktop

The file contained the lines:

[Desktop Entry]
Type=Application
Exec=/home/jhosier/stop-network-mounts-unity
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_GB]=stop-network-mounts-unity.desktop
Name=stop-network-mounts-unity
Comment[en_GB]=stop-network-mounts-unity

This means that when I login to Ubuntu 14.04 with Unity, the file /home/jhosier/.config/autostart/stop-network-mounts-unity.desktop is executed which in turn calls the script /home/jhosier/stop-network-mounts-unity, which in turn writes to the file /home/jhosier/test.txt confirming that the script is constantly running in the background.

Now when I insert a CD it appears in the Unity Launcher Bar and I can open and mount the CD.
Then when I eject the CD (whether pressing the eject button on the CD drive or right clicking on the icon in the Unity Launcher Bar and choosing Eject) the CD gets ejected and all my network shares are populated into the Unity Launcher Bar as before, but after about 1 second they then get removed from the Unity Launcher Bar.

I hope this helps you too.