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

Parse firefox profiles.ini files to get paths of profiles. #664

Merged
merged 3 commits into from
Nov 30, 2022

Conversation

jle64
Copy link
Contributor

@jle64 jle64 commented Nov 29, 2022

Parse firefox profiles.ini files to get paths of profiles

This parses firefox profiles.ini files to get the paths of the profiles instead of just treating any subdir of the firefox dir as a profile.

This allows supporting profiles without a dot in their name which the existing glob didn't match which can happen if they are named manually, as well as profiles configured to be outside of the firefox directory that were ignored and profiles that are symlinked (by adding a resolve() on the path before the is_dir()).

There is also an additional try condition to avoid failing for the remaining profiles if encountering a profile without the customChrome.css, as it might be installed on some profiles only.

Changelog

  • Fixed theming Firefox profiles that don't have a dot in their name
  • Fixed theming Firefox profiles that are outside of the Firefox dir
  • Fixed theming Firefox profiles that are symlinks
  • Fixed failing to theme remaining profiles after encountering one on which the firefox-gnome-theme is not present

Please note that I have only tested on non-flatpak Firefox.

This allows supporting profiles without a dot in their name, profiles
outside of firefox directory and profiles that are symlinked.
Copy link
Member

@0xMRTT 0xMRTT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution. It's look good to me.

@daudix-UFO what about you ?

@0xMRTT 0xMRTT requested a review from daudix November 29, 2022 19:55
@daudix
Copy link
Member

daudix commented Nov 29, 2022

@0xMRTT you know better, but it should not break anything, so LGTM!

@0xMRTT
Copy link
Member

0xMRTT commented Nov 29, 2022

As I can see there isn't any modifications that could result in a break for flatpak. Maybe we should test ?

@daudix
Copy link
Member

daudix commented Nov 29, 2022

Oki, give me a few minutes 😉

@daudix daudix self-requested a review November 29, 2022 20:01
@jle64
Copy link
Contributor Author

jle64 commented Nov 29, 2022

Just thinking about it, if someone uses absolute paths in a profile for a flatpaked firefox (with IsRelative=0 in profiles.ini), this could be an issue as absolute paths are not the same inside and outside the flatpak. But I doubt people do that in reality.

@daudix
Copy link
Member

daudix commented Nov 29, 2022

Likely no, I doubt a lot of people create additional firefox profiles than a default one.

Copy link
Member

@daudix daudix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Firefox via Flatpak works just fine.

@daudix
Copy link
Member

daudix commented Nov 29, 2022

@0xMRTT merging?

@0xMRTT 0xMRTT merged commit 9762701 into GradienceTeam:main Nov 30, 2022
@0xMRTT
Copy link
Member

0xMRTT commented Nov 30, 2022

@jle64 thanks for your contribution

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants