Skip to content

Commit

Permalink
[StatusNotifier] fix recursive icon search
Browse files Browse the repository at this point in the history
Tried to be too cute with previous code. Where there's no IconThemePath,
we got an empty `Path` object which is equivalent to `Path('.')` meaning
that we'd always do a recursive search on the current folder.

This PR fixes that by only creating a `Path` object if there is a theme
path.

Fixes qtile#4959
  • Loading branch information
elParaguayo committed Aug 12, 2024
1 parent 63ce551 commit 47f8634
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libqtile/widget/helpers/status_notifier/statusnotifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,12 @@ async def _get_local_icon(self, fallback=True):
return

try:
icon_path = Path(await self.item.get_icon_theme_path())
icon_path = await self.item.get_icon_theme_path()
except (AttributeError, DBusError):
icon_path = None

if icon_path:
self.icon = self._get_custom_icon(icon_name, icon_path)
self.icon = self._get_custom_icon(icon_name, Path(icon_path))

if not self.icon:
self.icon = self._get_xdg_icon(icon_name)
Expand Down

0 comments on commit 47f8634

Please sign in to comment.