Some time ago I needed to use an Hewlett-Packard printer. For this task I installed hplip-3.14.4. Printing worked, but on system start-up, there was always this blue HP symbol in my KDE tray, which only vanished after right clicking on the symbol and choosing “quit”.

Why does a printer driver need a system tray icon?

So, I recently decided to remove the driver, as the printer was no longer in use by me. This took a very long time and some serious disk activity. htop revealed, that the uninstaller (written in Python 2) executed the command
find /home -name .hplip
This means, the hplip uninstaller literally looks at every single file and directory you own to check if it is the “.hplip” directory. Note: The “.hplip” directory is always in the root of a user home directory, so searching sub folders of sub folders doesn’t find you anything at all. I literally can’t think of a more stupid way to do this.

Better ways to uninstall files include (ordered descendingly by quality):

  • Providing a way to use the distributions’ package manager to do installation and uninstallation
  • Keeping track of the files you install and create, so you can just go through that list and remove them later
  • Iterating through all users’ home directories and deleting the “.hplip” directory directly
  • Taking the above “find” command, but adding “-maxdepth 1” to only search in every users’ home folder and not subfolders. Note: In very special setups this does not always work, as user home folders can have a structure like “/home/students/alice”.

This is only a small rant on a very rantable topic: Linux drivers by hardware companies. At least there are some Linux drivers for most printers out there. How well they work and how well they are written however leaves much room for future improvement.