Live data from Hacker News

Show HN: boxxy – Control where Linux programs put files, without symlinks

github.com

111–120 of 250 posts

Re: Show HN: boxxy – Control where Linux programs put files, without symlinks

#111

Hah I was literally just complaining about applications not following the XDG directory spec today. there's a non-exhaustive list of applications on the archwiki [0] that put their config/data in dotfiles in the home directory. surprisingly, there's also lots of pushback from maintainers of projects who don't want to change this, for whatever excuse they can produce. a Reddit thread has some list of issues where the…

Can I also soapbox about the XDG_CONFIG_HOME (~/.config) folder having gigs of temp data in it? (I'm looking at you, Slack !) How awesome would it be to be able to back up my custom app configs just by copying around one tiny folder? Or throwing it in a git repo and knowing what config changed when? :\

The fault lies with Electron [0]. Open issue since 2016 to fix this behavior only for it to devolve into a morass of, “What is cache?”

[0] https://github.com/electron/electron/issues/8124

Re: Show HN: boxxy – Control where Linux programs put files, without symlinks

#112

Earlier quoted context omitted.

I mean, from the perspective of a person that hasn't heard about it before, this is just another standard[0]. I opened your links. There's no easy way to judge the traction or popularity of this. Why do you think maintainers should just apply another standard that's thrown at them? I don't mean to be dismissive nor criticize the standard itself. I'm trying to give you a glimpse of what a person that hasn't heard abou…

What are the competing standards to XDG? Stick everything in $HOME? Stick everything in $HOME/.config? Those 2 aren't standards and aren't helpful.

Yes, sticking everything into `$HOME/.toolname` is what most cross-platform software is doing, and I imagine that's just fine for the vast majority of users.

Re: Show HN: boxxy – Control where Linux programs put files, without symlinks

#113

Earlier quoted context omitted.

> some have hardcoded those paths in other scripts My sympathy is lacking, as is my respect for those running projects that hardcode paths. Stop hardcoding paths and the world will be a better place.

eg. ~./bashrc has existed there for 30+ years, changing stuff just because someone doesn't like seeing a file in a folder is imho stupid.

A hidden file, even. Stop using "ls -A" and you'll be fine.

Re: Show HN: boxxy – Control where Linux programs put files, without symlinks

#114

Earlier quoted context omitted.

The dotfiles and dotfolders directly in the home folder is "the way it was always done", and now some "new kids" came and want changes done to software which has existed before they were even born. People have muscle memory for those folders, some have hardcoded those paths in other scripts, others just don't care, and things stay as they always were. On one hand, it's great to have all the stuff in the same place, o…

The XDG base directory specification[0] was initially introduced in 2003; 20 years ago now. Yes there's plenty of software that existed before 2003 which didn't respect XDG, but most all of the Linux software dumping dotfiles in my homedir where written not just after 2003, but many years after 2003. For example, the following pieces of software all have dumped garbage in my homedir, and all are much less than 20 yea…

If only.

There is a single base directory relative to which user-specific data files should be written. This directory is defined by the environment variable $XDG_DATA_HOME.

There is a single base directory relative to which user-specific configuration files should be written. This directory is defined by the environment variable $XDG_CONFIG_HOME.

Neither of those environment variables is defined on a stock Ubuntu 22.04.1 LTS.

Re: Show HN: boxxy – Control where Linux programs put files, without symlinks

#115
post #5

Is this named after the one and only boxxy?!

No! I just thought it was a cute name ("put things in a box"), and it wasn't a common repo name on GitHub.

https://www.youtube.com/watch?v=Yavx9yxTrsw

You have no idea how much of a thing this was?

People either loved her or got irrationally angry if she was ever brought up to the point of committing federal crimes

Re: Show HN: boxxy – Control where Linux programs put files, without symlinks

#116

Yep, have an old Java application that wants to put calibration data for a vector network analyzer right in my home directory. This is a perfect tool.

Another solution might be to override the root user directory like:

_JAVA_OPTIONS="-Djava.util.prefs.userRoot=${XDG_CONFIG_HOME}/programName" programName

Re: Show HN: boxxy – Control where Linux programs put files, without symlinks

#117
post #105

> suggested usage > alias aws="boxxy aws" (repeat for other tools) If you could find a way to somehow intercept without requiring aliasing, this would be amazing. Also, as it is, isn't it problematic that programs might call others (outside of your shell, not respecting its aliasing). A neat semi-solution (still worse than transparent interception if somehow possible) would be to have a boxxy-run script sym-linkable…

I mean, you can just run "boxxy aws" if you don't want to make an alias. That's your solution for "intercept without requiring aliasing"

As the program intercepts file APIs for all processes launched under it, it should handle subprocesses just fine.

Re: Show HN: boxxy – Control where Linux programs put files, without symlinks

#118

Earlier quoted context omitted.

The dotfiles and dotfolders directly in the home folder is "the way it was always done", and now some "new kids" came and want changes done to software which has existed before they were even born. People have muscle memory for those folders, some have hardcoded those paths in other scripts, others just don't care, and things stay as they always were. On one hand, it's great to have all the stuff in the same place, o…

The XDG base directory specification[0] was initially introduced in 2003; 20 years ago now. Yes there's plenty of software that existed before 2003 which didn't respect XDG, but most all of the Linux software dumping dotfiles in my homedir where written not just after 2003, but many years after 2003. For example, the following pieces of software all have dumped garbage in my homedir, and all are much less than 20 yea…

Sure, XDG was introduced in 2003, but why would you expect developers to start to follow its rules instantly? At best, it started to gain some traction 4 or 5 years after that, but still today, it is far from universally accepted.

But take a step further back: why should anyone care about what the XDG says in first place? This isn't a dictatorship, and things were doing just fine long before a handful of people who wrote the XDG thought their ideas were the best approach.

It's been my observation that good standards can be adopted broadly and quickly with little controversy or need for advocacy. The fact that the XDG file layout still isn't universally used suggests it doesn't have as much value as its proponents think.

Re: Show HN: boxxy – Control where Linux programs put files, without symlinks

#120
post #105

> suggested usage > alias aws="boxxy aws" (repeat for other tools) If you could find a way to somehow intercept without requiring aliasing, this would be amazing. Also, as it is, isn't it problematic that programs might call others (outside of your shell, not respecting its aliasing). A neat semi-solution (still worse than transparent interception if somehow possible) would be to have a boxxy-run script sym-linkable…

Perhaps a better solution would have been not using the Linux namespaces but using LD_PRELOAD to preload a shared library to intercept all the FS-related API and normalize the path. Of course more complex and would only function for dynamically linked executables, but would have not required to launch the executable with a proxy and would also be more stable, not relying on not so stable features such as Linux namespaces.
Post reply on HN