New problem. Ubuntu 16.04/16.10. Now, whenever I start gparted, new disk partition icons appear, just above the trash can icon, in the Unity launcher. I have to "unlock from launcher" to get rid of them.

Older posts for older versions of Ubuntu propose various fixes that no longer apply in 16.04/16.10. Any ideas of how to permanently get rid of these pesky icons?

Here's a screenshot that shows the 3 icons, just above the trash can icon:

enter image description here

  • Please do add a screenshot Commented Aug 13, 2016 at 15:57
  • Screenshot won't let me take a snap of the 3 disk partition icons that get added whenever I run gparted, because the launcher won't scroll to the bottom of the launcher list when Screenshot is active. ps: If I could get a screenshot, how do I add it in the future?
    – heynnema
    Commented Aug 13, 2016 at 16:05
  • When you are editing your post, in the top bar, there is a little image icon. If you click it, it lets you embed an image. Commented Aug 13, 2016 at 16:07
  • Also, if you tell screenshot to do a full window snap with a delay, it should work :) Commented Aug 13, 2016 at 16:08

1 Answer 1


The cause

Removing devices from the launcher will blacklist the device in the (gsettings) key

com.canonical.Unity.Devices blacklist

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

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.

#!/usr/bin/env python3
import subprocess
import time
import os

key = "com.canonical.Unity.Devices"
bl_file = os.environ["HOME"]+"/.blacklist_data"

while True:

    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()           
    except FileNotFoundError:
        r = []
    if current != r:
        newlist = list(set([d for d in current+r if not d == '']))
        open(bl_file, "wt").write("\n".join(newlist))
        subprocess.Popen(["gsettings", "set", key, "blacklist", str(newlist)])

How to use

  1. Copy the script into an empty file
  2. Save it as remember_blacklist.py
  3. Test- run it by the command:

    python3 /path/to/remember_blacklist.py
  4. If all works fine, add to Startup Applications: Dash > Startup Applications > Add. Add the command:

    python3 /path/to/remember_blacklist.py


  1. Reading from gsettings (practically all what the script does) is extremely light-weight, and won't add any noticeable burden to your system
  2. 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.
  • Thanks for your help! I'll test it shortly. Then I'll come back and vote/accept.
    – heynnema
    Commented Nov 20, 2016 at 22:17
  • 1
    Seems to work! When I was testing it, I did a control-c to stop it, and I got this...$ python3 ~/bin/remember_blacklist.py ^CTraceback (most recent call last): File "/home/alheynneman/bin/remember_blacklist.py", line 23, in <module> time.sleep(2) KeyboardInterrupt How difficult would it be to add an "interrupt" handler that goes to a nice clean exit?
    – heynnema
    Commented Nov 20, 2016 at 22:28
  • @heynnema yeah, that' s what you should get when pressing Ctrl -c. It means the loop was stopped by Ctrl c. Else the loop would be unstopable. Commented Nov 20, 2016 at 22:31
  • 1
    What would happen... and I suppose it never would if it was in Startup Applications... that a control-c (or a kill?) would interrupt the writing to the .blacklist_data and corrupt it?
    – heynnema
    Commented Nov 20, 2016 at 22:33
  • Nono, that's when you run it from a terminal :) Commented Nov 20, 2016 at 22:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .