Live data from Hacker News

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

github.com

121–130 of 250 posts

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

#121

Earlier quoted context omitted.

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.

Short, memorable passwords like one's birthday or favourite pet's name are "just fine for the vast majority of users". It's a meaningless metric of quality - or more to the point - it isn't a metric of quality.

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

#122
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…

> If you could find a way to somehow intercept without requiring aliasing, this would be amazing.

I figured out while testing that `boxxy sh` works as expected, so I would imagine you can wrap any shell in it since it’s just a mount namespace.

> Also, as it is, isn't it problematic that programs might call others (outside of your shell, not respecting its aliasing).

Nope! Any spawned processes live inside the same mount namespace and see the same pretend view of the world.

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

#123

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.

As a defence of hardcoded paths might go, I could've done better myself. What else from your OS 30 years ago might you keep just because it's 30+ years old?

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

#124

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…

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…

I don't see the problem. There's no reason to choose one or the other when we can have both. Many programs try several options. Git for example tries ~/.gitconfig and ~/.config/git/config.

Do people seriously resist such non-destructive improvements just because they think it's offensive when younger programmers have opinions on legacy software?

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

#125

Earlier quoted context omitted.

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…

$XDG_DATA_HOME defines the base directory relative to which user-specific data files should be stored. If $XDG_DATA_HOME is either not set or empty, a default equal to $HOME/.local/share should be used.

$XDG_CONFIG_HOME defines the base directory relative to which user-specific configuration files should be stored. If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config should be used.

$XDG_STATE_HOME defines the base directory relative to which user-specific state files should be stored. If $XDG_STATE_HOME is either not set or empty, a default equal to $HOME/.local/state should be used.

https://specifications.freedesktop.org/basedir-spec/basedir-...

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

#126

Earlier quoted context omitted.

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…

But why should developers conform to that specific standard, if (for them, and many of their users) it makes more sense to use a "~/.wine" (or whatever other) folder? If i want to completely remove wine from my profile, how many folders do I have to delete doing it the old way? One - ~/.wine. How many using the new? One in .config, then .local/share, probably one in .cache... oh wait, .local/state too.. Probably.. we…

Following the standard does not require you don't have a single folder, it can all be changed with 4 simple environment variables. If you want to have everything dumped horrendously in your home folder nothing is saying you can't, it just wouldn't be the default, because it's simply not an orderly way to organize the files.

The biggest problem is programs that don't even let you change where they store the stuff, so even if you're okay with the default not being XDG you dont even have the option to make it respect XDG base directory specification.

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

#127

Earlier quoted context omitted.

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, as you say > most all of the Linux software dumping dotfiles in my homedir then is it really true, that the standard is in fact "well established"?

Right now I have in my home folder 4 undesirable dot something which should be somewhere else and I can't change it. Meanwhile, I have 63 folders in my .config which means most of the applications I'm using do respect the XDG base directory specification, only a few entitled or extremely legacy ones don't.

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

#128
If anyone would like to actually force the non-compliant applications to do the thing correctly, then xdg-ninja is your friend [0]. The script looks at all the dotfiles in the home folder and tells you what environment variables you have to set to make them follow XDG base directory specifications, in the cases where that's not possible it will show you the related GitHub issue or similar bug tracking option with the problem.

My current dotfiles [1] already have a lot of these and they mostly just work. Once in a while an application won't respect it completely, and so instead of having a mess with xdg + whatever the dev though was cooler I just let the application do it's thing so at least is somewhat predictable.

[0]: https://github.com/b3nj5m1n/xdg-ninja

[1]: https://github.com/DoodlesEpic/Dotfiles/blob/main/.profile

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

#129

Earlier quoted context omitted.

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.

As a defence of hardcoded paths might go, I could've done better myself. What else from your OS 30 years ago might you keep just because it's 30+ years old?

I keep it because it's worked for 30 years without issues and it's still working. Must you always replace something, just because a newer thing is "out there"? On the other hand, this is hackernews, and rewriting everything, from a text editor to a file browser, into a (ruby, go, rust,...) is a thing.

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

#130

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…

> There's no excuses for these programs not respecting standards that are 1. Well established by the time the software was written and 2. short

This isn't a standard, it's a convention at best. A freedesktop.org specification. Basically a scheme Red Hat people thought up and implemented widely in the open source software projects they control. It may be a useful abstraction but there's absolutely no obligation to conform to it. There doesn't have to be an "excuse" or any form of justification at all. "I just don't like it" is enough. I don't like those unsightly XDG variables either and it's entirely within my power as a software developer to trash the entire concept of XDG and do things in any way I see fit.

https://www.freedesktop.org/wiki/Specifications/

> freedesktop.org produces specifications for interoperability, but we are not an official standards body.

> There is no requirement for projects to implement all of these specifications, nor certification.

Post reply on HN