this post was submitted on 28 Sep 2023
659 points (98.7% liked)

Linux

50370 readers
905 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
top 50 comments
sorted by: hot top controversial new old
[–] 6xpipe_@lemmy.world 144 points 1 year ago* (last edited 1 year ago) (3 children)

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@sh.itjust.works 88 points 1 year ago* (last edited 1 year ago) (3 children)

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…

[–] pennomi@lemmy.world 26 points 1 year ago

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

[–] clearleaf@lemmy.ca 11 points 1 year ago (5 children)

I don't touch it either for two reasons that go together.

  1. It's a pig sty before I even get there.
  2. Nothing in there will ever be included in backups for that reason.

My cloud drive has SO much random flstudio crap in it. That's the worst program in the world when it comes to that. If you install their program they think they own your hard drive.

Also while I'm bitching about windows folders, why did they make it so weird to get to your home folder? It feels like we aren't supposed to know it exists anymore.

load more comments (5 replies)
load more comments (1 replies)
[–] thesmokingman@programming.dev 24 points 1 year ago (1 children)

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

load more comments (1 replies)
[–] Zeth0s@lemmy.world 21 points 1 year ago

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

[–] gnutrino@programming.dev 113 points 1 year ago (3 children)

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

[–] PseudoSpock@lemmy.dbzer0.com 27 points 1 year ago* (last edited 1 year ago) (1 children)

You still have sd devices? /s

load more comments (1 replies)
[–] chaorace@lemmy.sdf.org 26 points 1 year ago (2 children)

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

[–] hperrin@lemmy.world 19 points 1 year ago (4 children)

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)
[–] AKADAP@lemmy.ml 95 points 1 year ago (5 children)

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.

[–] herr@lemmy.world 55 points 1 year ago (5 children)

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.

[–] AdmiralShat@programming.dev 18 points 1 year ago (4 children)

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.

[–] Jakeroxs@sh.itjust.works 11 points 1 year ago

My Documents > My Games is kinda the default, but then you have steam cloud syncing and tons of games that default to various Appdata folder seemingly at random.

load more comments (3 replies)
load more comments (3 replies)
load more comments (3 replies)
[–] ouch@lemmy.world 77 points 1 year ago (17 children)

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)
[–] Gleddified@lemmy.ca 61 points 1 year ago (1 children)

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

[–] joyjoy@lemm.ee 70 points 1 year ago* (last edited 1 year ago) (5 children)

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@sh.itjust.works 29 points 1 year ago

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

[–] waspentalive@beehaw.org 16 points 1 year ago* (last edited 1 year ago) (3 children)

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.

load more comments (3 replies)
[–] darcy@sh.itjust.works 14 points 1 year ago (1 children)

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)
[–] tal@kbin.social 44 points 1 year ago* (last edited 1 year ago) (3 children)

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

[–] PlexSheep@feddit.de 20 points 1 year 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)

[–] rockstarmode@lemmy.world 14 points 1 year ago (2 children)

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)
[–] natecox@programming.dev 32 points 1 year ago (2 children)

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)
[–] guckfoogle@sh.itjust.works 31 points 1 year ago (5 children)

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.

[–] pitbuster@lemmy.ml 41 points 1 year ago* (last edited 1 year ago) (2 children)

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)

[–] mvirts@lemmy.world 12 points 1 year ago (2 children)

And maybe could still get them with testdisk 😁

load more comments (2 replies)
load more comments (1 replies)
[–] conc@lemmy.ml 18 points 1 year 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)
[–] JetpackJackson@feddit.de 25 points 1 year ago (11 children)

Me staring aggressively at Steam, Zotero, and bash:

(And more)

[–] loutr@sh.itjust.works 15 points 1 year ago (1 children)

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

load more comments (1 replies)
load more comments (10 replies)
[–] herr@lemmy.world 24 points 1 year ago* (last edited 1 year ago) (1 children)

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)
[–] sickday@kbin.social 23 points 1 year ago (8 children)

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

load more comments (8 replies)
[–] Urist@lemmy.ml 18 points 1 year ago* (last edited 1 year ago) (3 children)

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)
[–] Blizzard@lemmy.zip 17 points 1 year ago (1 children)

My $HOME is my castle (・へ・)

load more comments (1 replies)
[–] JoMomma@lemm.ee 15 points 1 year ago
[–] RandomLegend@lemmy.dbzer0.com 13 points 1 year ago

Yes please!

[–] elbarto777@lemmy.world 12 points 1 year ago

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

control its* permissions

[–] Infiltrated_ad8271@kbin.social 12 points 1 year ago

Someone should pass this on to valve.

[–] Moonrise2473@lemmy.ml 11 points 1 year ago

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"

[–] Magnetar@feddit.de 10 points 1 year ago (1 children)

W should make a .dotfiles directory for them.

load more comments
view more: next ›