this post was submitted on 28 Sep 2023
419 points (100.0% liked)

Linux

1259 readers
93 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 45 comments
sorted by: hot top controversial new old
[–] gnutrino@programming.dev 80 points 1 year ago (1 children)

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

[–] chaorace@lemmy.sdf.org 17 points 1 year ago (1 children)

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

[–] brunofin@lemm.ee 8 points 1 year ago
[–] AKADAP@lemmy.ml 64 points 1 year ago (3 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.

[–] BeeMe 1 points 1 year ago

This is why I've made a "Filing Cabinet" directory. My stuff goes in there nice and organized, while I ignore the rest.

load more comments (2 replies)
[–] nyan@lemmy.cafe 47 points 1 year 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. 😒

[–] Gleddified@lemmy.ca 43 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 48 points 1 year ago* (last edited 1 year ago) (2 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
[–] waspentalive 17 points 1 year ago* (last edited 1 year ago) (2 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.

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

Documents, Music, etc actually are configurable. Just edit ~/.config/user-dirs.dirs

[–] waspentalive 3 points 1 year ago

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.

[–] flying_sheep@lemmy.ml 5 points 1 year ago

That's the beauty: XDG compliant applications are entirely configurable using standardized environment variables.

[–] Mio@feddit.nu 1 points 1 year ago

Is it a problem to change this?

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

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

[–] pitbuster@lemmy.ml 2 points 1 year ago

Thanks I was going to look for one with multi OS support :)

[–] sickday@kbin.social 14 points 1 year ago (1 children)

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

[–] onlinepersona@programming.dev 6 points 1 year ago (1 children)

If a program just uses $HOME or someone starts writing a new application, how is that supposed to help?

[–] sickday@kbin.social 3 points 1 year ago (1 children)

You can manage symlinks pretty easy with home-manager. I'd personally setup symlinks for these app configuration directories if I don't want them storing files directly on the disk I use for $HOME. It's also done in a delcarative way that can persist across multiple computers.

[–] onlinepersona@programming.dev 3 points 1 year ago (2 children)

I'm not sure I understand. So you create a symlink from $HOME/.program.ini to something in the nix store? If so, how does that solve the problem of clutter in $HOME ?

[–] sickday@kbin.social 1 points 1 year ago

If so, how does that solve the problem of clutter in $HOME ?

If it wasn't clear from my message, the problem(s) these tools are solving for me would be 1. not having to keep track of my dotfiles and their directories, and 2. not storing configuration files directly on the disk I use for the $HOME dir. I'm not claiming these tools would solve clutter in the $HOME dir. Further, I think it should be alright for me to share tools for managing configuration files in your home directory in a discussion that directly relates to that subject.

So you create a symlink from $HOME/.program.ini to something in the nix store?

Normally it's the other way around. When you use nix and home-manager, you're technically generating files that will live in the nix-store and nix/home-manager will take care of symlinking those files to locations in your $HOME dir.

In this scenario though, I would use the https://nix-community.github.io/home-manager/options.html#opt-home.file option from home-manager to create a symlinks to a location that's outside of my $HOME dir so those files don't have to live on my home disk.

My particular use-case is that I want persistent configuration files that are shared throughout a handful of devices on my network. To this end, I use some home-manager symlinks that lead to a network folder where all these various directories and configuration files actually live. I edit those configurations in a single place and their changes propagate across the network to all the devices that would use them.

[–] Byter@lemmy.one 1 points 1 year ago

You're right, it doesn't. That does give me an idea though.

You could use overlayfs with an opaque upper directory to hide the files littering your $HOME and still access them by bind-mounting them into the appropriate xdg dirs.

Way more effort than it's worth, of course.

[–] JetpackJackson@feddit.de 12 points 1 year ago

Me staring aggressively at Steam, Zotero, and bash:

(And more)

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

Someone should pass this on to valve.

[–] JoMomma@lemm.ee 10 points 1 year ago
[–] RandomLegend@lemmy.dbzer0.com 9 points 1 year ago

Yes please!

[–] Moonrise2473@lemmy.ml 9 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"

[–] Urist@lemmy.ml 9 points 1 year ago* (last edited 1 year ago) (2 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).

[–] masterofn001@lemmy.ca 6 points 1 year ago (1 children)
[–] Urist@lemmy.ml 3 points 1 year ago

Yes, that is the one. Thanks!

load more comments (1 replies)
[–] Magnetar@feddit.de 7 points 1 year ago (4 children)

W should make a .dotfiles directory for them.

load more comments (4 replies)
[–] Mandrew002@lemm.ee 6 points 1 year ago

Hmmmmmm

No.

[–] RamdomSlaphead@feddit.uk 3 points 1 year ago

Cough Snap cough

[–] Mio@feddit.nu 2 points 1 year ago

Is there any good gui application for mange these but also edit them in a user friendly way like getting a dropdown for a settings like: Yes/No, Country Sweden. Number size range etc. So include validation. Even nix os does not have that.

[–] leastprivilege@lemmy.ml 2 points 1 year ago

I'm new to Linux. Should I be using something like chezmoi?

[–] some_guy@lemmy.sdf.org 2 points 1 year ago

It needed to be said.

[–] Mio@feddit.nu 1 points 1 year ago

Some bin folder in home folder?

[–] monobot@lemmy.ml 1 points 1 year ago

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.

[–] Blizzard@lemmy.zip 0 points 1 year ago

My $HOME is my castle (・へ・)