From e1ac6089434e1f541c44e529d750232255c4ab34 Mon Sep 17 00:00:00 2001 From: Thomas Queste Date: Tue, 5 May 2026 18:32:36 +0200 Subject: [PATCH 1/2] feat: handle Firefox data dir under .config/mozilla and fallback to .mozilla/config --- __init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/__init__.py b/__init__.py index d62c39a..3a4467d 100644 --- a/__init__.py +++ b/__init__.py @@ -163,7 +163,10 @@ def __init__(self): self.firefox_data_dir = Path.home() / "Library" / "Application Support" / "Firefox" self.firefox_icon_factory = lambda: Icon.fileType("/Applications/Firefox.app") case "Linux": - self.firefox_data_dir = Path.home() / ".mozilla" / "firefox" + # Try XDG-compliant location first, fallback to legacy path + new_path = Path.home() / ".config" / "mozilla" / "firefox" + legacy_path = Path.home() / ".mozilla" / "firefox" + self.firefox_data_dir = new_path if (new_path / "profiles.ini").exists() else legacy_path self.firefox_icon_factory = lambda: Icon.theme("firefox") case _: raise NotImplementedError(f"Unsupported platform: {platform.system()}") From d414259d71faae554f3d1231980a3ddf54a41d6b Mon Sep 17 00:00:00 2001 From: Thomas Queste Date: Tue, 5 May 2026 18:37:19 +0200 Subject: [PATCH 2/2] simplify code --- __init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/__init__.py b/__init__.py index 3a4467d..363518c 100644 --- a/__init__.py +++ b/__init__.py @@ -164,9 +164,9 @@ def __init__(self): self.firefox_icon_factory = lambda: Icon.fileType("/Applications/Firefox.app") case "Linux": # Try XDG-compliant location first, fallback to legacy path - new_path = Path.home() / ".config" / "mozilla" / "firefox" + xdg_path = Path.home() / ".config" / "mozilla" / "firefox" legacy_path = Path.home() / ".mozilla" / "firefox" - self.firefox_data_dir = new_path if (new_path / "profiles.ini").exists() else legacy_path + self.firefox_data_dir = xdg_path if xdg_path.exists() else legacy_path self.firefox_icon_factory = lambda: Icon.theme("firefox") case _: raise NotImplementedError(f"Unsupported platform: {platform.system()}")