Firefox now supports the Freedesktop.org XDG Base Directory Specification.
Posted by forumcontributer@reddit | linux | View on Reddit | 77 comments
Posted by forumcontributer@reddit | linux | View on Reddit | 77 comments
AlternativePaint6@reddit
Fucking finally.
For those unaware, this essentially means that rather than dumping all of its files into
~/.mozilla/directory, Firefox now splits its files properly into:~/.config/mozillafor bookmarks, theme, and other configs,~/.cache/mozillafor temporary cache files, and~/.local/share/mozillafor other persistent data like extensions.If everyone had done like Mozilla, your home directory itself would be filled with countless directories from all the apps. Now they are neatly separated under these few subdirectories.
githman@reddit
So I will have to backup two Firefox directories instead of one now lest I lose my extensions? Thanks for the warning.
JSouthGB@reddit
I'll now have to back up 3 Firefox directories.
githman@reddit
Which ones?
One of the three mentioned in the post above is cache. You do not need to backup it.
S7relok@reddit
You're still doing backup by hand?
AlternativePaint6@reddit
Most people use a Firefox account to sync their stuff on Mozilla's cloud, but yeah, if you do it manually then backup both .config and .local/share.
Lucas_F_A@reddit
The worst possible aggressor of this failing is golang. They don't drop a
.gofolder. They just drop agofolder and to annoy you.(Sorry it sounded ranty. Golang is a fine language, but I hate that we ever reached this point. Also, you can still use an env variable to put it somewhere else IIRC)
deikatsuo@reddit
Just imagine a random app deciding to delete your .config folder, every program you use would instantly lose all its settings. This is why Flatpak sandbox and permission system are important. They stop apps from poking around where they shouldn’t be in the first place
ComprehensiveYak4399@reddit
that random app can also delete your home folder?
nightblackdragon@reddit
Yeah, that's why we have backups.
wpm@reddit
In my history of using a computer for 3 decades, this has never happened to me on any platform.
phalp@reddit
Imagine your hard drive randomly deciding to fail
Rikiub@reddit
It's the same thing if you delete
~/.var.Lucas_F_A@reddit
Do flatpak apps have write access to the whole folder? I imagined it would be a subdirectory per app.
Rikiub@reddit
Flatpak apps don't have access to the whole folder, but the point is anything outside Flatpak can just delete
~/.var.But well, I doubt that something like that will happen.
fractalfocuser@reddit
SUBSCRIBE
scruffie@reddit
Most KDE apps dump their config files in
/.config. Some use more than one file (konsole.notifyrc,konsolerc,konsolesshconfig, which I assume are all forkonsole, but I can't be sure). It gets extra fun when trying to figure which of two similarly-named files is the one used, or whether the file from 2019 is still relevant.XFCE puts all their config files under
~/.config/xfce4. Be more like XFCE, KDE.Lucas_F_A@reddit
dreamscached@reddit
First thing I do on my new installation of a distro is setting a user session GOPATH env. At least Go has the decency to let you override the (dumb) default.
raineling@reddit
I am ignorant of the Go project but do have to use one golang application. Would you be kind enough to tell me or point me to where I can learn to set up this environment variable?
dreamscached@reddit
Unsure about your app specifically, what I mean here is I have to work with Go (as a developer) and I set
GOPATH(in~/.config/environment.d) so that dependencies are pulled into~/.gorather than~/goraineling@reddit
Oh, ok. Thank you, I misunderstood what you're doing. My mistake.
Lucas_F_A@reddit
Thanks heavens for that
Pandoras_Fox@reddit
One of the other reasons for doing a subdirectory inside of
~/.config- if you want to watch a file for changes (for live reloading); you'll want to watch its parent directory for inode swapping reasons.Putting your config in the top level of the XDG CONFIG HOME means you have to watch the entire configs directory for changes to ensure. Otherwise, :w in vim will clobber the original file by moving its buffer over it, which also clobbers the inode you're watching if you're just watching the single file.
Lucas_F_A@reddit
If I'm understanding correctly, watchers watch inodes, and to watch a file you need to watch the directory, which contains the list of files it contains (as inodes), because writing to a file will, (or at least may, I imagine? Depending on filesystem perhaps?) , change the inode of the file meaning your file watcher stops looking at what you care about.
Did I get that right? I never thought about that. Thanks for sharing
Pandoras_Fox@reddit
More or less, yeah! It actually boils down more to how the file gets written/updated.
If an editor writes to the file by opening it, writing bytes out, and closing, it'll be the same inode. If an editor does all of its edits to a buffer file, and then saves by moving or copying the buffer over the original file, the inode of the file will change.
afaik most text editors do the buffer swap method now, as it's more resilient against power loss during a save. I wrote a config watcher + hot reload system a few weeks ago and I had to do some digging into why it only reloaded once when I was watching the file itself directly - it was something I'd never really reasoned about before :)
Lucas_F_A@reddit
It's kinda cool that you did a project and a few weeks later you're sharing what you learned.
This clarifies it for me! The behavior of text editors you describe makes sense - I just looked it up and indeed a rename is atomic.
wpm@reddit
I prefer it being
~/go. The extra.char is just annoying and ugly.DerekB52@reddit
But the "." Hides it so i never need to see it.
qodeninja@reddit
lol vscode straight up does not care and make like 4 or 5
Lucas_F_A@reddit
Wait, what's that about dot net and dot Azure? Does vscode itself create them? Maybe an extension instead?
qodeninja@reddit
vscode is the only thing i use remotely tied to azure. i dont touch ms
nj_tech_guy@reddit
Flutter also does this, installs to \~/flutter
Lucas_F_A@reddit
Interesting that it's not a once off.
nightblackdragon@reddit
Does it? It seems these patches just change directory from $HOME/.mozilla to $HOME/.config/mozilla which mean it will still be just one directory so not exactly following XDG Base Directory Spec.
__konrad@reddit
I'm curious about is too. Hundreds of MB in .config dir is a big no.
Daerun@reddit
Shall we "clean" old directories/files from ~/.mozilla, or does Firefox do this on its own?
doranduck@reddit
From the linked bug report:
"Part of the long discussion on the bug covers it, but there is no migration path supported at this point: only new profiles are expected to use the new setup. Migrating manually is at your own risk, make a backup before."
forumcontributer@reddit (OP)
Wait for it to hit in release channel and after that 2-3 updates. It is still in the nightly.
muffinsballhair@reddit
I wish the specification also defined a place for var and log in the home directory though. They now just dumb it in
~/.local/sharefor that which doesn't seem like the right place, something like~/.varbeing defined would be nice.Dwedit@reddit
This might make it harder to copy a Firefox user profile from Windows.
Prior-Advice-5207@reddit
They do not. Cache was in .cache for a long time, now they just moved everything that was in .mozilla before to .config/mozilla. There is no use of .local in that patch I could find.
DriNeo@reddit
I have never understood how developers can believe that their software will be the only one in the world.
03263@reddit
But they did, and it is. Hence why I mainly use ~/Downloads as my landing and move stuff to the other home folders (documents, pictures, etc) but rarely look at ~/.
kmikolaj@reddit
I would rather say: "With all the apps following XDG Base Directory Spec, they are instead filling these few subdirectories with countless directories from all the different apps."
mrlinkwii@reddit
honestly i dont see the issue , i see nothing wrong with using .mozilla
zulu02@reddit
My home directory IS filled with countless from all the different apps 😑
kemma_@reddit
I’m wondering how it will be implemented. Will they move files in new place or I will have to do it myself like an idiot
forumcontributer@reddit (OP)
Firefox treat themes as an extension. UUID.xpi in extensions directory in .mozilla/firefox/[profileID].[profileName]/
ipsirc@reddit
https://github.com/queer/boxxy
JoeKazama@reddit
Holy shit any day where I know my "ls -la ~ | wc -l" will show one less count is a good day!
wristcontrol@reddit
LMAO, still not installing it.
Smooth_Signal_3423@reddit
I literally just educated myself on XDG standards last week and cleaned up my home directory. I was surprised to learn that Mozilla was XDG-non-compliant and that I had to symlink
~/.config/mozillato~/.mozilla. Glad to know I can update that as soon as this version makes it to Debian stable!LuisBelloR@reddit
Maybe in a year, with luck! 😅
DamianINT@reddit
Maybe more, since debian has firefox-esr not current
nicman24@reddit
you know, after the layoff these past 3 years, i think there is nothing that bothers me about ff. except maybe the ai sidebar
starm4nn@reddit
The thing I find really funny is that Firefox seems really reluctant to turn nicher features into extensions. They could even install these extensions by default if they wanted.
It seems win-win. Users could remove functionality they don't want, Firefox can better ensure these APIs have useful functionality, and the core browser remains less bloated.
nicman24@reddit
they cant. they could with the old xul extensions. now with the watered down webextensions2 they just cannot.
kill-the-maFIA@reddit
At least it's opt-in and you can plug local models into it, I guess
nicman24@reddit
Yeah I don't care about that, I mostly care that it pops out when I press Ctrl H to see my history
CheCheDaWaff@reddit
I've replaced
~/.mozillaand similar folders with symlinks into somewhere more logical. I wonder what will happen to me when I get this update.pan_kotan@reddit
That's great. Now, the question is: how to migrate, w/o losing your data?
Wimzel@reddit
21 years in the making 🤪
forumcontributer@reddit (OP)
Finally they have technology to do it.
kemma_@reddit
It’s more like Linux hit critical mass and bypassed 5% share
Wolnight@reddit
Firefox is also the "Microsoft Edge of Linux" since it comes with basically all distributions. I think their desktop userbase using Linux is higher than 5%.
forumcontributer@reddit (OP)
Sadly it is under 5%.
GreatBigBagOfNope@reddit
That's the inverse question though - 11% of all Firefox installs are on a Linux desktop, but the question the previous commenter was asking was what proportion of all Linux desktops have Firefox installed
Wolnight@reddit
Oh really? How though? I don't think many use Firefox on Windows and Mac, while I expected higher usage on Linux. I know that Chrome and Brave are two very popular alternatives (looking at the total Flathub downloads), but I would have said that like 50% of Linux users use Firefox.
funforgiven@reddit
Considering that Windows probably has 30× the users of Linux, 5% looks OK.
qodeninja@reddit
`mkdir`
theclovek@reddit
Exactly. They were limited by the technology of their time.
qodeninja@reddit
Im glad im not the only one losing my mind over hostile apps dropping their doo doo in my home directory
DesiOtaku@reddit
Searching though the bugzilla, it didn't mention what the solution is for snap packages. I assume Firefox snap will continue to use the ~/snap/firefox/ folder, correct?
EverythingsBroken82@reddit
now do thunderbird? xD
Pramaxis@reddit
yes pls 😭
formegadriverscustom@reddit
What the hell, I just saw a pig flying outside right now!