Live data from Hacker News

Dotfile madness (2019)

0x46.net

71–80 of 185 posts

Re: Dotfile madness (2019)

#71
post #20
post #8

The solution is simple, stop messing your home and put personal data in /home/you/personal/ source code in /home/you/src/ The home is not a place supposed to store random "regular files"

On the contrary, that's exactly what it's supposed to be.

Yeah but no putting the genie back in the bottle.

So the next best is to find another place as your home as the OP explains. That's what I do.

Re: Dotfile madness (2019)

#72

Earlier quoted context omitted.

When using .Net 6 I use Environment.GetFolderPath( SpecialFolder.LocalApplicationData) in Windows this maps to ~/AppData/Local An in Linux to ~/.local/share so it is configured well

I'm not sure I'd call that configured well. On Linux, share is supposed to contain static data used by the app, not the changing configuration that normally goes into appdata on Windows. For config the equivalent should be ~/.config/appname

He's getting the wrong folder on Windows too because that's what he's requesting when passing in SpecialFolder.LocalApplicationData. SpecialFolder.ApplicationData returns %USERPROFILE%\AppData\Roaming on Windows and ~/.config on Linux.

Re: Dotfile madness (2019)

#73

I completely agree! That's why I created this site: https://xdgbasedirectoryspecification.com . We need some place where people can immediately understand the practical benefit, and the minimum ask of their users. Of course, it doesn't help just to complain about the issue in a void, so I've also submitted like 10 PRs and filed quite a few issues. Projects like pnpm and Poetry took note, and now they comply! Someone'…

Am I missing something, or should the Python example use "config_dir[0] != '/'"? I.e. if it's empty, or if the first character is not a forward slash, then use the default?

no I think you're right, that was a typo

Re: Dotfile madness (2019)

#74

Earlier quoted context omitted.

> With modern C++, there's probably a way to do this in a nicer manner, and achieve runtime polymorphism with virtual functions or a lambda (function pointer) table. You proved my point. Creating an #ifdef mess with polymorphism, virtual methods and indirection is the very definition of going out of one's way to support something that really doesn't need any support.

If a developer writing in C/C++ is targeting Windows, then bringing in ` ` (and associated headers) is almost guaranteed, especially if said developer wants to work with native APIs (unless said program will rely on MinGW/Cygwin/Msys2, which are arguably worse , since they drag in an entire Linux directory tree per application ). This is just part of the cost of developing cross-platform, and I'm sorry, but to me, di…

Are the developers of "Unix-first software (such as `ssh`)" targeting Windows though? I don't think so. They don't deserve to be shamed for this stuff. They aren't "sloppy", Windows is lucky to get ports at all.

Re: Dotfile madness (2019)

#75

I completely agree! That's why I created this site: https://xdgbasedirectoryspecification.com . We need some place where people can immediately understand the practical benefit, and the minimum ask of their users. Of course, it doesn't help just to complain about the issue in a void, so I've also submitted like 10 PRs and filed quite a few issues. Projects like pnpm and Poetry took note, and now they comply! Someone'…

The following programs are for Linux only (The XDG Base Dir Spec isn't inherently followed for MacOS and Windows) You should fix this. While macOS and its system applications and bundled applications don't adhere to the XDG Base Directory Specification; many programs that run on macOS do. In fact, almost all of the programs you list run on macOS and (by definition) use the XDG Base Directory Specification. So I would…

Hmm, that's why I said inherent? Because as you mentioned there is a separate macOS directory structure and the system utilities don't follow the specification. Also, the specification is only written for Linux in mind, which is why I said "not inherent for macOS.

Is there an exact phrasing you would prefer?

Re: Dotfile madness (2019)

#76
This problem can be solved by simply not storing anything in the home directory. Kepp your files in a separate directory like /data or /files and leave home directory for configs.

Storing your files in /home is also bad because usually /home uses Linux-specific filesystem and you won't be able to access your files from Windows. Storing files in NTFS partition solves this problem.

Re: Dotfile madness (2019)

#77
post #48

Earlier quoted context omitted.

My home directory has dotfiles for aspell, bash, bzr, cargo, Clojure, CPAN, CVS, Darcs, D-BUS, Dillo, DOSBox, DOSEmu, Emacs, Eclipse, Emacs, ESD, FLTK, fontconfig, FontForge, GForth, GHC, the GIMP, Git, GnuPG, Gnuplot, Guix, IceWM, Idle, Java, John the Ripper, Jython, Links2, MilkyTracker, Mozilla (Firefox), MPlayer, Nethack, Octave, Racket, R, Skeinforge, Slic3r, SSH, SQLite, Subversion, Units, Vim, W3M, WINE, X-Win…

> it would not improve my user experience for those "apps" to look for my configuration file in two different places Some of those already do, though. At least Vim and Emacs do, and I personally have zsh in .config as well.

Yeah, Emacs looking in both .emacs and .emacs.d has been a headache from time to time.

Re: Dotfile madness (2019)

#78
post #77

Earlier quoted context omitted.

> it would not improve my user experience for those "apps" to look for my configuration file in two different places Some of those already do, though. At least Vim and Emacs do, and I personally have zsh in .config as well.

Yeah, Emacs looking in both .emacs and .emacs.d has been a headache from time to time.

Isn't .emacs.d still in your $HOME? I thought the path was $XDG_CONFIG_HOME/emacs

Re: Dotfile madness (2019)

#79
post #77

Earlier quoted context omitted.

Yeah, Emacs looking in both .emacs and .emacs.d has been a headache from time to time.

Isn't .emacs.d still in your $HOME? I thought the path was $XDG_CONFIG_HOME/emacs

Oh, is it doing that too, now? Ugh. Three possibilities is worse than two.

Re: Dotfile madness (2019)

#80

What I personally find more egregious are dotfiles and dot-dirs on Windows , created by half-baked ports of Unix-first software (such as `ssh`). Windows has `%APPDATA%` and `%LOCALAPPDATA%` that are accessible with `ShGetKnownFolderPath`[0], using the appropriate `KNOWNFOLDERID`[1]; all programs should put their configuration and cache data in these paths. Windows also doesn't know what the dot at the beginning of a…

I think "hidden" files are a bad idea. What's the point of hiding some of the files in a directory from user? It only makes things more confusing.

For example the folder might look empty but in fact it could contain thousands of hidden files. You want to delete it as it is empty but accidentally delete important system files.

Even worse, imagine if all files on an USB drive are marked as hidden. You see that the drive is empty but when you attempt to copy something to it see a message that there is no free space.

One more example. Imagine if you have a project and want to edit an .env file. But as dotfiles are hidden in Linux you don't see this file and cannot open it. It turns out that Windows Explorer which doesn't hide dotfiles is much better for developing projects with Docker!

There should be no hidden files. We cannot do anything with Windows and their MS-DOS legacy but Linux could stop hiding dotfiles in GUI and CLI commands.

Post reply on HN