654
submitted 9 months ago by [email protected] to c/[email protected]
top 50 comments
sorted by: hot top controversial new old
[-] [email protected] 144 points 9 months ago* (last edited 9 months ago)

XDG gang, rise up!

Also, I know that this community and dot-files in general are Unix based, but this holds true for Windows development as well. You should be putting app files in the users' %APPDATA% directory, not their user folder. It's probably even more important since Windows doesn't autohide dot files.

[-] fartsparkles 91 points 9 months ago* (last edited 9 months ago)

The My Documents / Documents folder on Windows is a dumping ground for game saves and random applications. I no longer use it for saving my documents anymore…

[-] [email protected] 27 points 9 months ago

Yep, my ~/Projects folder is where I keep anything I need to actually find. All the normal places are full of random cruft.

load more comments (8 replies)
[-] [email protected] 24 points 9 months ago

One of my proudest accomplishments is contributing to the XDG Base Dir spec. I fixed a typo.

load more comments (1 replies)
[-] [email protected] 21 points 9 months ago

Unfortunately not even Microsoft does that... On windows having a logical order is a lost battle

[-] [email protected] 116 points 9 months ago

I just write my config files directly to random unused blocks on /dev/sda, filesystems are overrated.

[-] [email protected] 28 points 9 months ago* (last edited 9 months ago)

You still have sd devices? /s

load more comments (1 replies)
[-] [email protected] 26 points 9 months ago

Nah, dump em' to /tmp/ and let the user figure out the rest

[-] [email protected] 19 points 9 months ago

I just leave all config in memory. If the user really cared, they would never reboot.

load more comments (4 replies)
load more comments (1 replies)
load more comments (1 replies)
[-] [email protected] 91 points 9 months ago

I absolutely despise the following directories: Documents, Music, Pictures, Public, Templates, Videos. Why? Because applications randomly dump stuff into these directories and fill them with junk files. I don't want any application putting anything into directories I actually use, unless I explicitly tell them to. It is not possible to keep your files organized if applications randomly dump trash files into them.

[-] [email protected] 55 points 9 months ago

Same shit happens on Windows. Games will just install their shit literally all over OS with no rhyme or reason to it.

Why can't the save game and config.ini just be in the main god damn game directory? Nobody knows.

[-] [email protected] 22 points 9 months ago

Actual reason is system permissions.

Most the default installation path is Program Files. That needs elevation to write to. Fine when you’re installing something, but not something you want to need just to run the game.

Writing to %APPDATA% or really anywhere in %USERHOME% is guaranteed to have the right permissions for this user.

Granted, a lot of home PCs and gaming PCs are single-user environments. The “personal” computer. In that case there’s no reason games and applications can’t be installed in %LOCALAPPADATA%, and in fact, I think windows has an environment variable or registry setting for that.

It’s no different in Linux. You don’t want users writing to /etc. And you may expect multiple users. So all of that stuff goes to dot files in $HOME.

load more comments (3 replies)
[-] [email protected] 19 points 9 months ago

Microsoft OWNS not just gaming companies, but one of the largest gaming hardware companies and many of the largest game developers.

You'd think by now we'd get a dedicated Saves folder to organize this shit after this long.

load more comments (4 replies)
load more comments (3 replies)
load more comments (2 replies)
[-] [email protected] 81 points 9 months ago

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. 😒

[-] [email protected] 38 points 9 months ago

~/go is one of my major pet peeves.

[-] [email protected] 24 points 9 months ago

That's not the only folder go creates. There's also ~/sdks/go1.xy

load more comments (1 replies)
load more comments (2 replies)
load more comments (1 replies)
[-] [email protected] 77 points 9 months ago

If you care, please take time to upvote or file bugs on packages that don't follow XDG. Or even better, make PRs.

load more comments (17 replies)
[-] [email protected] 55 points 9 months ago

One of my greatest pet peeves is random folders appearing in my home folder. Thanks for this

[-] [email protected] 68 points 9 months ago* (last edited 9 months ago)

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
  • .pyenv
  • .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
[-] darcy 29 points 9 months ago

i can almost ignore the hidden ones, but ~/go? no thats just rude

[-] darcy 14 points 9 months ago

afaik, tmux can use ~/.config/tmux/tmux.conf or something, if ~/.tmux is not found

load more comments (1 replies)
load more comments (2 replies)
[-] [email protected] 44 points 9 months ago* (last edited 9 months ago)

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

[-] [email protected] 20 points 9 months ago

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)

[-] [email protected] 14 points 9 months ago

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.

load more comments (2 replies)
load more comments (1 replies)
[-] guckfoogle 31 points 9 months ago

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.

[-] [email protected] 41 points 9 months ago* (last edited 9 months ago)

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)

[-] [email protected] 12 points 9 months ago

And maybe could still get them with testdisk 😁

load more comments (2 replies)
load more comments (1 replies)
[-] [email protected] 19 points 9 months ago

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.

load more comments (3 replies)
[-] [email protected] 30 points 9 months ago

The rust library mentioned there doesn’t support system install paths for windows or macOS, it only uses XDG. I recommend the directories crate which properly supports Linux, Mac, and Windows.

https://github.com/dirs-dev/directories-rs

load more comments (2 replies)
[-] [email protected] 25 points 9 months ago

Me staring aggressively at Steam, Zotero, and bash:

(And more)

[-] loutr 15 points 9 months ago

To be fair, bash was released a decade before the XDG specs.

load more comments (1 replies)
load more comments (10 replies)
[-] [email protected] 24 points 9 months ago

Nix and Home Manager have been my go-to for managing dotfiles and symlinks in my home dir

load more comments (8 replies)
[-] [email protected] 24 points 9 months ago* (last edited 9 months ago)

And wtf is with anaconda3 just permanently changing your "user@machine" terminal prompt?? Who thought that was a good idea?

load more comments (1 replies)
[-] [email protected] 20 points 9 months ago

My $HOME is my castle (・へ・)

load more comments (1 replies)
[-] [email protected] 17 points 9 months ago* (last edited 9 months ago)

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).

load more comments (3 replies)
[-] [email protected] 15 points 9 months ago

I hate it when an application puts its configuration data in its own dotfile under $HOME instead in ~/.config. Also hate it when caches are stored in ~/.config, because then I have to manually tag those subdirectories for exclusion before doing a backup.

[-] [email protected] 14 points 9 months ago

Yes please!

[-] [email protected] 14 points 9 months ago
[-] [email protected] 12 points 9 months ago

A user may want to back it up as an important part of their system, control it’s permissions,

control its* permissions

[-] [email protected] 12 points 9 months ago

Someone should pass this on to valve.

load more comments
view more: next ›
this post was submitted on 28 Sep 2023
654 points (98.7% liked)

Linux

45773 readers
797 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS