Removing devices from the launcher will blacklist the device in the (
However, if the device is removed (disconnected in any way), the device is also removed from the blacklist. On next time you connect the device, the story starts over again.
The solution below will store blacklisted devices in a file. After removing them once, the device will never show up again in the launcher. If you disconnect a device, the script will immediately (re-) add the device as blacklisted.
key = "com.canonical.Unity.Devices"
bl_file = os.environ["HOME"]+"/.blacklist_data"
current = subprocess.check_output([
"gsettings", "get", key, "blacklist",
if "@as" in current:
current = 
current = eval(current)
r = open(bl_file).read()
r =  if r == '' else r.splitlines()
r = 
if current != r:
newlist = list(set([d for d in current+r if not d == '']))
subprocess.Popen(["gsettings", "set", key, "blacklist", str(newlist)])
How to use
- Copy the script into an empty file
- Save it as
Test- run it by the command:
If all works fine, add to Startup Applications: Dash > Startup Applications > Add. Add the command:
- Reading from
gsettings (practically all what the script does) is extremely light-weight, and won't add any noticeable burden to your system
- If (and a long as) the device is opened in any
nautilus window, it will still show up in the launcher. The icon will however not be locked to the launcher, and disappear.