Also if the normal invocation of your program produces more than 3k lines of stdout, sanitize it and default to a file.
You might wanna backup your dotfiles somewhere remote too. I literally lost dotfiles that I’d been building up for years because I couldn’t remember the password to my Linux machine after coming back from vacation. Funny enough though, a couple hours after nuking my OS I magically remember my password.
Unless you disk was encrypted, you could have booted up a live distro and back up the files you needed (or even overwrite the shadow file to get a new password)
And maybe could still get them with testdisk 😁
I really did try so many forensic and recovery tools after remembering my password but with no luck 😂
I’m glad you tried! Stories of needless data loss really get to me 😹
In the late 90s I taught an intro course for folks who wanted to run *nix boxen (Solaris, IIRC). On the afternoon of the last day I had them swap places after lunch and gain root access to each others’ machines. It was partly for root passwd recovery and other maintenance tasks, but also to demonstrate that physical access to the box was a serious issue.
Oof. Yeah, I once forgot my LastPass password literally less than 30 seconds after entering it on another device. Muscle memory versus active memory kind of thing.
i couldn’t recite my most-used passwords if i tried. i would need to ‘air type’ them out while doing so.
Put your dotfiles in git (or source control of your choice)- massages it easier to propagate improvements across machines!
After two years of typing in the same boot pass on my same laptop at my same job I woke up one day and couldn’t remember it. Almost died trying. Right as I was reaching out to my admin it came to me.
.word
Some bin folder in home folder?
Here is nice help for python software to determine XDG directories (and more): https://pyxdg.readthedocs.io/en/latest/basedirectory.html
PyXDG contains implementations of freedesktop.org standards in python.
Tangentially related: I recently learned that there are tools for handling dotfiles such as chezmoi and yadm. I would suppose that after spending some time on backing up the dotfiles that matter one can purge the remainders without much issue. I also remember some tool that was made for the purpose of cleaning $HOME, but can not recall its name (if anyone knows please let me know).
xdg-ninja maybe?
Yes, that is the one. Thanks!
deleted by creator
Y’know what’s worse? When there’s no dot. Worse than that, it’s an undotted directory used to store a single config file. Ugh, unpleasant memories. 😒
~/go
is one of my major pet peeves.That’s not the only folder go creates. There’s also
~/sdks/go1.xy
Oh god, what? Is that new? Aside from the plethora of shit that are dotfiles living in ~ instead of under
~/.config
, the only outlier I have at the moment is~/go
.
That’s just the default location for what it’s worth. You can move GOPATH wherever you want.
Doesn’t mean the defaults shouldn’t be sane
There’s a version control system called darcs that stores its configuration files in a
_darcs/
directory in your project and it wounds my soul.
I’d like to set nautilus to show hidden files, but I can’t stand the amount of “trash” there’s in home
Everyone is thinking “my app is the best, it totally deserves a ~/.myappisthebest directory”
W should make a .dotfiles directory for them.
export XDG_CONFIG_HOME=/home/juser/.dotfiles
Well, isn’t it
.config
by default?Yes, but OP wanted
.dotfiles
. Nice thing with XDG is that you can change all that.The user directories Desktop, Downloads, etc. can be changed as well: https://wiki.archlinux.org/title/XDG_user_directories
…that’s assuming that apps actually respect that environment variable. The problem is that if the app is writing to ${HOME} then they’re already not following XDG spec.
They may not want their configuration stored in $HOME, for example:
they’re on a machine that isn’t under their physical control and ~/.config is mounted over the network from their personal machine;
That sounds like it’s a bad way to handle configuration, since among many other problems, it won’t work with the many programs that do have dotfiles in home directory, but even if that happened, you could just symlink it.
they prefer to version control their configuration files using git, with a configuration directory managed over different branches;
I do that. I symlink that config into a git-controlled directory. If OP plans to put his entire ~/.config in git, he is doing things wrong, because some of that needs to be machine-local.
the user simply wants to have a clean and consistent $HOME directory and filesystem
If whatever program you are using to view your home directory cannot hide those files, it is broken, as it does not work with a whole lot of existing software.
less secure,
If your home directory is “not secure”, you’re probably in trouble already.
Like, there are reasons you may not want to put dotfiles in a homedir, but none of the arguments in the article are them.
EDIT: I will ask developers to stop dumping directories and files that don’t start with a dot in people’s home directories, though. I gave up over twenty years ago and put my actual stuff under ~/m just to keep it from being polluted with all the other things that dump non-dotfiles/-dotdirs in a home directory. Looking at my current system, I have:
-
A number of directories containing video game saves and configuration. I am pretty sure that these are mostly bad Windows ports or possibly Windows programs under WINE that just dump stuff into a user’s home directory there (not even good on Windows). Some are Windows Steam games.
-
WINE apparently has decided that it’s a good idea to default to sticking the Windows home directory and all of its directories in there.
-
Apparently some webcam software that I used at one point.
-
A few logfiles
Somehow I’ve never considered using git for version controlling/version synchronizing anything other than exclusively code… Brb gonna git all my files.
I agree with most of your points. Just wanted to add that I use Git + GNU Stow to manage this exact situation and it works flawlessly.
I just keep all my actual stuff in a separate /stuff partition, so my home folder is only config files. Then I use NixOS home-manager and Impermanence to manage the dotfiles.
Yeah, I think I tried it and it didn’t do something I wanted and so used a homebrew script for the same thing, but it or a similar package or script is definitely what I’d recommend.
That should work with dotfiles in .config, in the home directory, any other config you want to be portable across machines, etc.
I agree with most of your points, but I still think putting configs in the xdg dir instead of putting tons of dotfiles in $HOME is good practice.
I find dotfiles to be that stuff that I want to edit easily, and xdg stuff to be that stuff that I don’t edit frequently (manually at least)
-
Cough Snap cough
Great read, thanks for sharing this!
Me staring aggressively at Steam, Zotero, and bash:
(And more)
You aren’t using the Steam flatpak?
I’m using the Snap Flatpack of Steam, but I’m thinking of wrapping that in an AppImage because screw all of these idiot distribution walled gardens.
wh… what. lmao yall just say as many buzz words as possible.
Yeah, it was supposed to be a snarky joke about the horrible trend of packaging in app stores, but I suspect it feel through, and everyone is just interpreting it how they like. I think including AppImage threw the joke off, because that one doesn’t suck so much.
“appimage doesn’t suck” is a funnier joke than the original.
“… so much.” Don’t leave the important qualifiers out!
I could argue that it’s the worst of the three… Appimage is awful.
Flatpak are better. Snap is…
To be fair, bash was released a decade before the XDG specs.
Ah true. Bash doesn’t bug me as much as Zotero cause at least it’s a .bashrc file. With Zotero it’s a whole folder! In $HOME! Absolute madness!
It needed to be said.
One of my greatest pet peeves is random folders appearing in my home folder. Thanks for this
Let’s count them. (not including legacy or standard locations like .local, .config, or .cache, .ssh, and shell configuration files
- .aws
- .azure
- .bun
- .byobu
- .cargo
- .dbus
- .docker
- .dokku
- .keychain
- .kube
- .minikube
- .motd_shown
- .node_repl_history
- .npm
- .nuxt
- .nuxtrc
- .nvm
- .oh-my-zsh
- .pack
- .psql_history
- .python_history
- .redhat
- .ruff_cache
- .rustup
- .selected_editor
- .sqlite_history
- .sudo_as_admin_successful
- .tmux.conf
- .tox
- .ts_node_repl_history
- .vim
- .viminfo
- .vimrc
- .vscode-server
- .wget-hsts
- .yarn
And a couple more, non-hidden files for Go.
- go
- sdk/go1.20
Why aren’t all of these just normal directories under either .local (for data files) or .config (for configuration)???
Actually, I think the XDG directories should be under a single XDG directory either dotted or not (a better name would be OK with me) ~/xdg/Documents, ~/xdg/Music, ~/xdg/Pictures etc.
Documents, Music, etc actually are configurable. Just edit
~/.config/user-dirs.dirs
I also had to (under KDE)
-
Edit the settings for each of the folders in Dolphin (The file manager)
-
Edit the location of the desktop folder in the settings found by right-clicking the desktop and going into “Configure Desktop and Wallpaper” Location.
-
Edit the show item by choosing Custom Location, and adding the XDG directory for the desktop. This setting may not stick.
-
That’s the beauty: XDG compliant applications are entirely configurable using standardized environment variables.
i can almost ignore the hidden ones, but
~/go
? no thats just rudeIs it a problem to change this?
If these were links to issues that could be reacted to, I’d totally do that.
afaik, tmux can use
~/.config/tmux/tmux.conf
or something, if~/.tmux
is not foundNeat! Git has the same behavior.