After 17 years, Firefox will finally support XDG Dir spec!?
Posted by Damglador@reddit | linux | View on Reddit | 151 comments
Just randomly got an email today about the bug closing, couldn't believe that it's real.
ilybeamic@reddit
Iām more impressed they kept track of a 21-year old bug ticket with metadata like contact info than I am impressed they finally decided to respect the XDG spec.
TwoSongsPerDay@reddit
Tried Firefox Nightly, but it still creates a .mozilla directory in $HOME, containing only an empty 'extensions' directory. The rest of the files seem to be created properly in $XDG_CONFIG_HOME/mozilla/firefox. So effectively there's two mozilla directories being created, instead of one.
No-Highlight-653@reddit
the bug could drink, vote and drive.
freedomlinux@reddit
Uhhh maybe not in that order.
Straight-Version-996@reddit
Vote first, then drink and drive
oftenInabbrobriate@reddit
Drive first, vote after and then get drunk. Like a civilised person
bissynessman@reddit
but how you gonna get to the ballots if you dont drink and drive first?
Likver@reddit
then drink, drive, vote, drink again and vote a second time
TheFeshy@reddit
Not since they started attacking vote by mail. Now voting has to come last, so drink, drive, vote.
gljames24@reddit
You don't sober up with some light voting?
IntelligentSpite6364@reddit
The person who fixed the bug could have been born after the bug was first reported
No-Highlight-653@reddit
its highly possible
TwoSongsPerDay@reddit
Tried Firefox Nightly, but it still creates a .mozilla directory in $HOME, containing only an empty 'Extensions' directory. The rest of the files seem to be created properly in $XDG_CONFIG_HOME/mozilla/firefox. So effectively there's two mozilla directories being created, instead of one.
National_Increase_34@reddit
What does this do, if anyone is willing to explain?
mfdali@reddit
Basically, it would stop polluting your home folder and put Fireox's files in their respective, correct locations. The Arch wiki is nice: https://wiki.archlinux.org/title/XDG_Base_Directory
Real-Abrocoma-2823@reddit
Finally! Will next update on arch move .mozilla to .config?
_ahrs@reddit
I think they are keeping .mozilla for backwards-compatibility but there will probably be a way to move it manually. I'm not sure the procedure though.
forumcontributer@reddit
Don't worry arch wiki would point to some script.
non-existing-person@reddit
Historically every app was just creating
~/.app-namedirectory/config file. This polluted$HOMEdirectory. Some folks got offended by it. So they invented XDG standard for directories.XDG_CONFIG_HOMEusually just points to~/.config. So now apps write to$XDG_CONFIG_HOME/.configwhich is more consistent as (ideally) all configs will be in~/.configor in directory of user choice. There are also more directories likeXDG_DATA_HOMEfor when you need to store/usr/share-like data in home directory.razorree@reddit
yeah. and now some apps put GIGS of data (cache and other stuff) in \~/.config :(
instead of \~/.cache for example
wpm@reddit
Oh no, gigs of data in $FOLDER_A instead of $FOLDER_B, at least now it's respecting the XDG environment variables instead of shitting it all over your home dir's root
razorree@reddit
it's about being able to quickly remove all cache, or just backup .config folder without GIGS of @$%$#
arcimbo1do@reddit
It's not about writing to ~/.config/app instead of ~/.app, it's about putting config, cache and data in different directories, so that you don't have to backup lots of crap and it's easier to find config files.
Firewolf06@reddit
for big caches that matters, because i should be able to easily nuke caches without having to go find where your app hides it
Damglador@reddit (OP)
FOLDER_A is specifically meant only for configs, so you could for example just copy the whole ~/.config to a new machine without having to reconfigure every piece of software. I don't have to explain why cache is bad for this.
I can at least understand when Unity or games dump there saves, they are at least somewhat valuable and not a dead weight.
Plus cache outside of $XDG_CACHE_HOME means you can't just easily clean cache by deleting one folder.
It is still better than shitting in $HOME.
hackingdreams@reddit
"Some apps" failing to implement a standard correctly is not the standard's fault. It's "some apps" fault.
razorree@reddit
yep. i understand it's not "standard fault", but stupid app.
Real-Abrocoma-2823@reddit
Why use chrome on Linux? You have Firefox.
Expensive-Blood859@reddit
every electron app ever is knocking
altermeetax@reddit
Unfortunately lots of apps are badly designed and use a single directory for all data, and they had to pick one.
FeepingCreature@reddit
well that's not xdg fwiw. xdg has a well-defined cache dir.
jack123451@reddit
So now instead of one
.mozillafolder we'll get three.mozillafolders in subdirectories? Can all application data be neatly categorized into config, cache, and data? What is the advantage of this approach compared to putting a top-level app-specific directory under~/Librarylike on macOS or~/AppDatalike on Windows? That would give app developers freedom to organize their app-specific directory as they see fit.amroamroamro@reddit
Windows has %AppData%, %LocalAppData%, registry, etc
it really doesn't put everything in "a single directory"
__konrad@reddit
In Windows home dir you can also find
.cache/fontconfigand.gtk-bookmarks...amroamroamro@reddit
yeah that's the "etc" part I mentioned hehe
some programs put dotfiles in %USERPROFILE% folder, some use MyDocuments, there's even more locations like %ProgramData%
and windows registry is even more of the wild wild west...
and then you have programs that use hardcoded locations instead of winapi calls to query known locations, which causes problems for users that move the default folders to custom locations, like:
https://www.elevenforum.com/t/move-or-restore-default-location-of-documents-folder-in-windows-11.8708/
That's to say that its a mess on windows too lol
non-existing-person@reddit
It's just a Unix thing. Historically apps were installed in different locations.
/usr/sharefor data/usr/binfor binaries/var/cachefor cache etc.This made a lot of sense back then, when HDDs were small. You could create a single
/usr/shareand then mount it in 100s machines regardless of arch. Then you could have/usr/binfor each arch./var/cachecould be on a faster disk. And so on.It makes little sense to do same today and in $HOME to be honest. But I guess it is what it is. I guess it has an advantage of just doing simple
rm $cache_dirto quickly free space from cache data that will be recreated anyway.TheTilde@reddit
Best answer so far, thanks.
iwesp@reddit
It also makes sense to be able to exclude the cache dir when creating backups / syncing multiple machines.
cornmonger_@reddit
any standard is better than just dumping it in $HOME
wpm@reddit
They are not all under one directory in ~/Library in macOS. Firefox's configuration lives in ~/Library/Preferences (or system-wide configs at /Library/Preferences), caches live in ~/Library/Application Support/ or in ~/Library/Caches, etc. There is not a "Firefox" folder in my Library directory.
That said, I really wish Linux would drop the dreadful FHS for GUI apps and adopt something closer to macOS' hierarchy (for the capitalized folders that is)
samueru_sama@reddit
Well for example that means I can go and delete the
XDG_DATA_HOMEof a specific application and I know the cache is cleared.if you put that all into a single directory then it is not clear where the cache files are located and it is likely to different between apps.
Same way you can delete the
XDG_CONFIG_HOMEof the application and you know you just reset the settings of the app and nothing else.But don't go and do this without checking, it turns out that a lot of apps that "follow" the spec don't do it correctly, for example chromium browsers throw everything, data, cache, etc into their
XDG_CONFIG_HOMEdirectory.Flachzange_@reddit
Nothing is stopping you from setting XDG_CONFIG_HOME, XDG_DATA_HOME, XDG_STATE_HOME and XDG_CACHE_HOME to the same directory. The whole point is that the user can set it to whatever they want, the default behaviour is just that, a default.
necrophcodr@reddit
Well they don't write to $XDG_CONFIG_HOME/.config hopefully, but $XDG_CONFIG_HOME/, since $XDG_CONFIG_HOME would most often be $HOME/.config.
pervertsage@reddit
Offensive indeed! I certainly don't like a messy $HOME!
arcimbo1do@reddit
That's why they used ".app", so that ls doesn't show them by default. Out of sight, out of mind...
non-existing-person@reddit
I just embrace the chaos xD. Can't win with everything anyway. I just don't use
-ain ~ :PDamglador@reddit (OP)
*$XDG_CONFIG_HOME/ (preferably lowercase I think)
XDG config is meant for configs that user can interact with, like settings, XDG data is for data that is important but doesn't need user's attention, like login info or save files, XDG cache is for cache and XDG state is for logs and history files.
Gugalcrom123@reddit
There is also share which is used for plugins and similar
Damglador@reddit (OP)
XDG_DATA_HOME is ~/.local/share, the data directory I was referring to
hak8or@reddit
Oh wow, this is such a succinct way of describing them! Thank you! I was trying to get one of my tools to follow the xdg spec but got somewhat confused by the specs description of what should go where, but this is way better.
non-existing-person@reddit
Yes, you are right. Brain fart on my side :)
meditonsin@reddit
Instead of every app making some
.somethingdirectory or file directly in your home directory, the XDG standard defines.configfor configuration,.cachefor volatile data.local/sharefor non volatile stuff (think/usr/share) and stuff like that.This splits the different data types and keeps your home directory cleaner.
Also, all of those paths can be customized via environment variables, like
XDG_CONFIG_HOME,XDG_CACHE_HOMEand so on.Avamander@reddit
Over these past years my $HOME folder had accumulated more than 50 different dotfiles. It gets extremely cluttered and sometimes you can't even properly identify what software decided to take a shit.
The biggest shitters left now are Snap, Gradle, Jupyter, Docker and Cargo.
KaCii1@reddit
Go is still bad for it, think.
Damglador@reddit (OP)
Doesn't create yet another dot folder in $HOME called
.mozilla, amongst other file managing benefits.NotAF0e@reddit
oh hell yes, that .mozilla directory was confusing me big time
PureTryOut@reddit
The specification specifies standard location for various kind of files programs use or make. It defines for example
~/.config/<appname>as the standard place for config files,~/.local/share/<appname>for persistent runtime data, and~/.local/state/<appname>for temporary runtime data. It also includes standard environment variables that can overwrite those standard locations if the user or distribution wishes it so.Any application properly following the specification will not store files in the root of
$HOMEany more, making for a cleaner home folder. Another big benefit is that having the configs on it's own proper location makes it easy to back them up, sync them between machines or keep track of them via dotfiles repos with git for example.Moontops@reddit
XDG compliant programs should first check $XDG_CONFIG_HOME before defaulting to $HOME/.config
itaranto@reddit
No, that's not true.
If
$XDG_CONFIG_HOMEisn't defined, it must default to$HOME/.configinstead.protestor@reddit
This one is new for me
egzygex@reddit
XDG base directory spec defines a few environment variables that specify directories which are supposed to be used by applications. these default to
~/.configfor config files,~/.local/sharefor application data,~/.cachefor cache, etc. the intention is that application keep their files confined in these few dirs instead of polluting user's home directory with dotfiles.Firefox currently just stores everything in
~/.mozilla/firefox, like most apps used to before XDG directory spec became the de-facto standard.https://wiki.archlinux.org/title/XDG_Base_Directory
Own-Bug606@reddit
There are several environment variables like XDG_CACHE_HOME and XDG_CONFIG_HOME which refers to the config folder for applications. Some apps respect them some don't. Firefox ignores the vars and always puts the .mozzila folder in the home directory of user.
Virtual-Ad5017@reddit
XDG_DIRS is just a set of directories for programs to write to, and a standardized way to change these. Like, downloads go to ~/Downloads, configs to ~/. config, etc. So, basically, less clutter for everyone, and customization for those who need that.
kill-the-maFIA@reddit
I switched to the flatpak a while ago, but regardless... Finally. I don't want yet another .app folder cluttering my home directory
johnnyfireyfox@reddit
So, ~/snap/firefox/common/.config/mozilla for me in the future :D
Historical-Hand8091@reddit
It's good to see Firefox finally aligning with the XDG spec, as this should improve consistency across Linux environments.
Gyrochronatom@reddit
So it took 17 years to change a folder?
mallardtheduck@reddit
Changing the default location is easy, but handing the migration of data requires a bit of work. For an issue that has basically zero user impact, it's not surprising that it wasn't considered a priority.
ashleythorne64@reddit
You don't even need to migrate data. Check if .mozilla exists, if so, use that folder. If not, use the xdg dir.
__konrad@reddit
Snap devs: Let's copy silently .mozilla to ~/snap/firefox/ breaking backups and other stuff
abbidabbi@reddit
It's supposed to be the other way around. First, check the standard-compliant directories for user data, then fall back to the old, non-standard-compliant directories. If neither exist, create new files in the standard-compliant paths when writing data.
daemonpenguin@reddit
That's backwards. Think about it for a second. If you did this on a computer that had never installed Firefox before, then your data would always be saved in the legacy location.
You need to check for the legacy option first and, if it doesn't exist, assume we should use the new approach.
savyzzyz@reddit
No, u/abbidabbi is correct:
1) Does the standards-compliant directory already exist? If so, use it.
2) Otherwise, does the legacy directory already exist? If so, use it.
3) Otherwise (if neither exists), create and use the standards-compliant directory.
turbotop111@reddit
Dude above you is correct (like you), he just didn't word it all that well.
that means on a new machine it defaults to the XDG location
mallardtheduck@reddit
But then people will complain that Firefox is still "polluting" their precious home directory even after they've upgraded.
1Buecherregal@reddit
People who care about that are able to move the folder
Damglador@reddit (OP)
Basically yes. Best case scenario - split the folder in a bunch of folders to properly follow the spec (so cache in cache, configs in configs, data in data and logs with history in state), so like 17 years to split data from 1 folder to 4. But basically yes.
Damglador@reddit (OP)
By the look of patches, it seems like they dump everything in $XDG_CONFIG_HOME, which is... not the best way of doing things. Anyway. 17 years to change a folder.
VoidDuck@reddit
I'm happy they did it that way. I personally prefer to have everything Firefox-related in a single directory, it makes migrating an existing profile to another system much easier.
GlassCommission4916@reddit
If it followed the spec properly you could configure it to do that if you wanted, you do realize that right?
VoidDuck@reddit
I don't want to configure anything, I just want to continue being able to copy and paste a mozilla directory, load it to a new system and go on with business as usual. Which will still be the case and it's fine. Whether it's
~/.mozillaor~/.config/mozillais irrelevant to me.GlassCommission4916@reddit
If setting 2 env vars once per system is such a herculean task for you, what are you doing on linux?
VoidDuck@reddit
If it ain't broke, don't fix it. I have nothing against manual configuration, but I don't see the point of making things that currently work without any configuration needed more cumbersome either.
GlassCommission4916@reddit
It's not even more cumbersome, in the scenario where they implemented xdg base dir spec like other modern programs do, you wouldn't have to remember to remove or exclude the cache before backing it up, and instead you just have to set it up once. The way it is now is cumbersome.
Just because you're used to working around how it is now doesn't make it good design, in that sense it is broken for people that expect better.
VoidDuck@reddit
I think we actually agree. As I said, if only the cache would be separated from the rest of
.mozilla, I'd be fine with that. As long as everything else still resides inside a single directory and I don't have to hunt for pieces of Firefox profiles in~/.local/share,~/.local/state... all good for me.GlassCommission4916@reddit
We agree that they should respect
XDG_CACHE_HOME, but what I'm saying is that they should also respectXDG_STATE_HOMEandXDG_DATA_HOME, not justXDG_CONFIG_HOME, because the flexibility it brings is very much worth having to set those vars once if you wanted them to not be separate.Damglador@reddit (OP)
Flawed logic. If a person is willing to deal with one set of complications, it doesn't mean they'll enjoy having more of them.
Note: I'm not saying the move to .config is a big complication.
ypnos@reddit
Do you really want to carry over the huge cache when migrating a profile? It's what I always have to clear out first. Which would not be necessary if it were in
~/.cache/mozillaVoidDuck@reddit
If only the cache is separate, why not (I indeed clear the cache too before migrating), but I don't want settings and user data (bookmarks, passwords, etc.) to be stored in different places.
Damglador@reddit (OP)
That's fair. Separating that would actually be difficult.
I think what they should've done is left browser settings in .config and put everything else in .local/share, because data that you can't interact with doesn't belong in XDG config I think, but who cares anyway.
RanidSpace@reddit
kinda sucks :/ the firefox folder is so crowded and i only ever use like 3 config related files. though the fact that things are split into profiles already, maybe it's a good solution.
KnowZeroX@reddit
There were a lot of complex stuff dependent on the change. So it wasn't as simple as do the change, you had to do other changes first before that one. So that took time.
hdrgeswhsfa@reddit
It's typical Mozilla
CaptainStack@reddit
Great! Now do custom search engine sync š¤
granadesnhorseshoes@reddit
Cool beans. A bunch of new environment variables users don't know about that I can use to persistently hijack their browser sessions without privilege escalation.
Leliana403@reddit
You think the xdg dirs spec is new? Have you just woken from a coma?
Yeah because ~/.mozilla has until now been unreadable without root.
Go away and come back when you know what you're talking about.
the_abortionat0r@reddit
That guy is a fucking idiot.
the_abortionat0r@reddit
What are you even talking about? You feeling ok kid?
Damglador@reddit (OP)
Why would you need privilage escalation in the first place? The browser runs in userspase with user privileges, the files are right there, if anything it adds a bit obfuscation by allowing browser data to be stored in non-standard locations.
There's other logical holes here, but I'm not wasting time on it.
FedMellow@reddit
woohoo
DesiOtaku@reddit
I wonder how this will work with snaps because they have their own folder (which is half the reason why I hate using them).
6e1a08c8047143c6869@reddit
Kind of sucks that they decided against following the XDG base spec and just moved
.mozilla/to.config/mozilla/. Also Link to the issue in question: https://bugzilla.mozilla.org/show_bug.cgi?id=259356Latlanc@reddit
let's split everything so it's harder to find!
Firewolf06@reddit
how is moving config into the agreed upon directory literally naked "config" harder to find?
Damglador@reddit (OP)
Do you really need to find cache?
haakon@reddit
Is this only about the config directory? It already puts its cache in
~/.cache, which is XDG compliant.11Night@reddit
good news throughout the day š
Damglador@reddit (OP)
What are the other good news?
gen2brain@reddit
So they just moved from .mozilla to .config/mozilla? What about .cache and .local/share?
Damglador@reddit (OP)
I believe cache is already where it belongs (unlike with Chromium).
dekeonus@reddit
I'm not sure when mozilla started using
.cachebut it's been quite a number of years.I have a very faint memory of simplifying my backup scripts to remove mozilla specific cache handling.
gen2brain@reddit
Yeah, i now about chrome, disaster. Config directory measured in GB. I just want to nuke the cache when I feel like it.
Damglador@reddit (OP)
The worst thing is, it propagates that bullshit to all Electron apps as well
abbidabbi@reddit
Unfortunately, OpenSSH and BASH won't ever implement the XDG base dir spec because of (historic) "reasons" (at least that was the excuse the last time I've checked a few years ago). There's nothing which should prevent developers from implementing it while staying fully backwards compatible. Unless they deem third-party applications which hardcode those config/cache/data/state files important for their own project. The only other reason is stubbornness or lack of understanding.
Also very much infuriating whenever new and important tools come up which don't implement the spec from the beginning and mindlessly pollute the home dir. Looking at cosign (.sigstore) for example. Shameful.
kriebz@reddit
Luckily these aren't X programs and have no reason to care about XDG recommendations.
abbidabbi@reddit
The XDG base dir spec applies to all kinds of applications, CLI/TUI/GUI or no interface at all. In fact, it has nothing to do with any of that. Your comment is nonsensical.
kriebz@reddit
It just doesn't seem like two very fundamental programs that are installed on many systems that aren't Linux, or sometimes aren't even UNIX-like, would make a change on the recommendation of the X Desktop Group. And as much as I love the work Freedesktop.org has done to make and keep Linux on the desktop a viable thing, the basedirs thing seems like a silly idea to me anyway. Harder to type, harder to find things, more steps to remove poop left behind by a program you have un-installed.
Damglador@reddit (OP)
The spec allows you flexability, one you don't get with everything hardcoding shit to $HOME. If you want all program files in one place, just set
XDG_{CONFIG,CACHE,DATA,STATE}_HOMEto one directory. I want my HOME directory to be MY home directory, not of my programs, only I decide with what I will clutter it.Damglador@reddit (OP)
The spec allows you flexability, one you don't get with everything hardcoding shit to $HOME. If you want all program files in one place, just set
XDG_{CONFIG,CACHE,DATA,STATE}_HOMEto one directory. I want my HOME directory to be MY home directory, not of my programs, only I decide what to shit in it.SeaHour4933@reddit
Dunno about ssh, but it seems plausible that Bash will support the spec sometime this decade: https://savannah.gnu.org/support/?108134
cwo__@reddit
Just in time for Flatpak to break it anyway :-/
HeyKid_HelpComputer@reddit
Flatpak to break what? At least Flatpak by default puts the .mozilla file in it's .var/app/org.mozilla.Firefox directory so it's not in your home directly.
cwo__@reddit
I don't care whether it's in
~/.mozillaor~/var/app/org.mozilla.Firefox/mozillaor whatever, none of these is~/.configetc. as it should be.HeyKid_HelpComputer@reddit
That's the whole point of this post. You realize that right?
Flatpak will inherent the changes Mozilla will make and your flatpak Firefox will move from .mozilla to using .config inside the flatpaks' directory.
Of course if you're complaining that the flatpak won't use your \~/.config instead of
~/var/app/org.mozilla.Firefox/.configThat is trivial to change with flatseal and giving the Firefox flatpak access to xdg-config.
cwo__@reddit
Yes, inside the flatpak's directory, which is not what the spec says - it should be in whatever I set XDG_CONFIG_HOME to.
You can give it access to that, but it overwrites XDG_CONFIG_HOME inside the flatpak container with its own directory (and you can't override it at launch time by passing
--env=XDG_CONFIG_HOME=~/.configto flatpak --run... or at least it didn't work when I tried it.) So this would only work for programs that hardcode.config/instead of reading the correct directory from XDG_CONFIG_HOME.abbidabbi@reddit
Thunderbird still has four more years left to fix this, if it took Firefox 17 years to implement the XDG base directories:
https://bugzilla.mozilla.org/show_bug.cgi?id=735285
Damglador@reddit (OP)
I'd expect them to follow the change, since I think it's just a reskin of Firefox.
daemonpenguin@reddit
.... Thunderbird is an e-mail client, not a web browser.
Damglador@reddit (OP)
See, Outlook is also an email client, but it doesn't stop it from using Chromium as the base. Same thing.
Starlifter4@reddit
Ummmm....good?
nosacz-sundajski@reddit
This is the oldest bug I'm still tracking: https://issues.chromium.org/issues/40588292
itaranto@reddit
HOLLY FUCK!
Damglador@reddit (OP)
My reaction when I checked email ^
murlakatamenka@reddit
mrtruthiness@reddit
In other news: Optional specifications are optional.
bew78@reddit
Do you know if the change will be automatic or is there a manual action to take ?
HeyKid_HelpComputer@reddit
Based on how 99% of Linux software works that can utilize multiple directories it will:
Check the best location of xdg-dir first, if that folder and files exist it will use those, if not it will fallback to any existing legacy locations and if found it will use that.
So I would bet money it won't be automatic. You'll either have to delete the .mozilla folder or migrate it yourself.
There are tools like xdg-ninja that have great CLI checks and instructions for other software.
Damglador@reddit (OP)
Hopefully we'll see in the release notes, I'm sure someone will document in on https://wiki.archlinux.org/title/XDG_Base_Directory as well
asm_lover@reddit
so how does that work?
will it migrate existing data to the folder?
seaal@reddit
Absolutely wild how I was just dealing with this issue on Bolt Launcher [0], refreshed reddit and see this post. 2026 Year of Linux desktop confirmed.
[0] - https://github.com/Adamcake/Bolt/issues/86
itaranto@reddit
Let's just wait for Brodie's video about this...
floconildo@reddit
So happy that they found time in between AI slop and Google bootlicking to do actual dev work.
mina86ng@reddit
Says while pushing people away from the only alternative to Google-lead browsers.
Triangle_Inequality@reddit
There was a little popup yesterday suggesting I install a chat bot. Made me sad. But on the bright side, at least they don't force it on you like other browsers.
floconildo@reddit
I'm kinda fed up with Firefox settling for "better than". Can't wait for some real competition once Servo and Ladybird are here.
Abdowo@reddit
Finally, I hope the folks at Valve give a comment on the issue [Feature Request] Follow XDG Base Directory Specification, which has been open since 2013.
kalzEOS@reddit
I had to search this, ngl. lol
ipsirc@reddit
It must have been hard work.
AtlanticPortal@reddit
It reminds me of the GNOME bug for the file opener. I believe that this doesn't beat it as the longest one not being implemented for a certain amount of time.
dankobg@reddit
Never expected this from them
nalakawula@reddit
Fantastic news!