Skip to content
This repository was archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
Firefox theme plugin: correctly parse installations with multipe prof…
Browse files Browse the repository at this point in the history
…iles (#626)

# Allows theming firefox/librefox installations with multiple profiles

The old code would incorrectly iterate over files (such as the
profiles.ini file) which would trigger an exception and skip the entire
firefox installation. This checks the path to ensure it is a directory
(and thus a profile) before trying to open the customChrome.css file for
writing. It correctly themes my Librefox now.

## Changelog

- Fixed path iteration
  • Loading branch information
0xMRTT authored Oct 11, 2022
2 parents ae95423 + ddef0bd commit 35e14b3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions data/plugins/firefox_gnome_theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,10 @@ def apply(self, dark_theme=False):
"~/.var/app/org.mozilla.firefox/.mozilla/firefox",
"~/.var/app/io.gitlab.librewolf-community/.librewolf"]:
try:
with (
next(Path("firefox").expanduser().glob("*.*"))
/ "chrome/firefox-gnome-theme/customChrome.css"
).open("w") as f:
f.write(self.template.format(**self.variables))
for result in Path(path).expanduser().glob("*.*"):
if Path.is_dir(result):
with open(f"{result}/chrome/firefox-gnome-theme/customChrome.css","w") as f:
f.write(self.template.format(**self.variables))
except OSError:
pass
except StopIteration:
Expand Down

0 comments on commit 35e14b3

Please sign in to comment.