def _lookup_icon(self, name):
        """Search for the icon corresponding to one command."""
        self.icons_files[name] = None

        # expands ~ if name is a path and does nothing if not
        ipath = os.path.expanduser(name)

        # if the software_name is directly an absolute path icon file
        if os.path.isabs(ipath):
            # name start with '/' thus it's an absolute path
            root, ext = os.path.splitext(ipath)
            img_extensions = [".tif", ".tiff", ".bmp", ".jpg", ".jpeg", ".gif", ".png", ".svg"]
            if ext in img_extensions:
                self.icons_files[name] = ipath if os.path.isfile(ipath) else None
            else:
                # try to add the extension
                for extension in img_extensions:
                    if os.path.isfile(ipath + extension):
                        self.icons_files[name] = ipath + extension
                        break
        elif has_xdg:
            self.icons_files[name] = getIconPath(name, theme=self.theme_path)
        # no search method found an icon, so default icon
        if self.icons_files[name] is None:
            self.icons_files[name] = self.default_icon
Search for the icon corresponding to one command.
libqtile/widget/launchbar.py