Gleddified,

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

joyjoy, (edited )

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,

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,

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

waspentalive,

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,
@flying_sheep@lemmy.ml avatar

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

mod,

If these were links to issues that could be reacted to, I’d totally do that.

darcy,
@darcy@sh.itjust.works avatar

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

darcy,
@darcy@sh.itjust.works avatar

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

flying_sheep,
@flying_sheep@lemmy.ml avatar

Neat! Git has the same behavior.

Mio,

Is it a problem to change this?

JetpackJackson,
@JetpackJackson@feddit.de avatar

Me staring aggressively at Steam, Zotero, and bash:

(And more)

FlexibleToast,

You aren’t using the Steam flatpak?

sxan,
@sxan@midwest.social avatar

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.

zwekihoyy,

wh… what. lmao yall just say as many buzz words as possible.

sxan,
@sxan@midwest.social avatar

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.

zwekihoyy,

“appimage doesn’t suck” is a funnier joke than the original.

sxan,
@sxan@midwest.social avatar

“… so much.” Don’t leave the important qualifiers out!

FlexibleToast,

I could argue that it’s the worst of the three… Appimage is awful.

sxan,
@sxan@midwest.social avatar

No proprietary app store, no server to run, no additional software to install… truely stand-alone applications… what’s not to like?

FlexibleToast,

The truly stand-alone part is the worst part. It doesn’t integrate with your system well and has no convenient way to keep apps up to date.

bennieandthez,
@bennieandthez@lemmygrad.ml avatar

bro building the ultimate sandbox.

garam,
@garam@lemmy.my.id avatar

Flatpak are better. Snap is…

loutr,
@loutr@sh.itjust.works avatar

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

JetpackJackson,
@JetpackJackson@feddit.de avatar

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!

Linus_Torvalds,

Great read, thanks for sharing this!

RamdomSlaphead,

Cough Snap cough

nyan,

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

pivot_root,

~/go is one of my major pet peeves.

joyjoy,

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

pivot_root,

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.

andrew,
@andrew@lemmy.stuart.fun avatar

That’s just the default location for what it’s worth. You can move GOPATH wherever you want.

Badland9085,

Doesn’t mean the defaults shouldn’t be sane

Chobbes,

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.

TankieTanuki,
@TankieTanuki@hexbear.net avatar

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.

demesisx,
@demesisx@infosec.pub avatar

deleted_by_author

  • Loading...
  • TheEntity,

    How does it help to write an application storing its files in the right place? It helps the user, sure, but that's not what this post is about.

    demesisx,
    @demesisx@infosec.pub avatar

    Duly noted.

    alper_celik,

    Even when using home manager or any other dotfile manager your $HOME folder is still filled with junk. It maybe in your controlled repo but it still ends up as symlink to that repo.

    Infiltrated_ad8271,
    @Infiltrated_ad8271@kbin.social avatar

    Someone should pass this on to valve.

    sickday,
    @sickday@kbin.social avatar

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

    onlinepersona,

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

    sickday,
    @sickday@kbin.social avatar

    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,

    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,
    @sickday@kbin.social avatar

    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,

    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.

    pivot_root,

    Is there an easy way to learn this for just the package manager? Most of the tutorials I find are tailored to NixOS, which I’m not using and don’t plan on using.

    sickday,
    @sickday@kbin.social avatar

    For what it's worth, I don't understand the nix language or all the package manager functions in their entirety. I generally use what I need and that's it. Most information I've required that is nixpkgs-specific I was able to find in the manual. home-manager has one as well and it's been the best reference for me.

    Chobbes,

    You can absolutely use nix and home-manager without NixOS, you can even use it on a Mac!

    Most of the tutorials I find are tailored to NixOS

    I think that’s less true than you think. There’s definitely a lot of tutorials from people who do use NixOS… But this mostly doesn’t matter, using nix is more or less the same regardless of operating system. There is some stuff specific to NixOS, but that’s mostly just using nix to configure system services.

    Is there an easy way to learn this for just the package manager?

    That said… There’s not a super easy gateway to learning nix, unfortunately. The easiest way to learn is probably to try to package one of your personal projects, or by learning home-manager and trying to fully declare your home environment. Packaging programs in certain languages can involve having to learn more about the nix ecosystem than others (e.g., python is a little more complicated than what you’d need to package a simple C program, because python has it’s own ecosystem that you have to integrate with).

    Probably the best introduction is the nix pills if you want to learn how nix works (not necessarily how to use it, but it will give you a really solid foundation):

    nixos.org/guides/nix-pills/

    Though, it’s really common for people to bounce off of the nix pills because they start kind of slow. If you can follow through them, though, you’ll have a good understanding of the nix language and how it’s used to construct derivations for building packages.

    The nix language is much maligned, but it’s actually not as bad as you think going in (error messages can be ATROCIOUS, however). It looks a bit weird, but I think if you go in with the understanding that it’s “Turing Complete JSON” you’ll have a better time. Almost everything you’re doing in nix is building up attribute sets (which are basically just JSON dictionaries) which specify the dependencies and build stages of a project… But it’s not a static representation like JSON, you can call functions to do arbitrary computations to build up fields (e.g., I have some functions to automatically set up wireguard configurations from a description of the network layout of my machines, so it’s useful to be able to do this stuff).

    natecox,
    @natecox@programming.dev avatar

    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.

    github.com/dirs-dev/directories-rs

    6xpipe_,
    @6xpipe_@lemmy.world avatar

    Same with Python. I use a combination of the platformdirs and xdg libraries.

    pitbuster,
    @pitbuster@lemmy.ml avatar

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

    tal, (edited )
    @tal@kbin.social avatar

    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
    rockstarmode,

    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.

    tal, (edited )
    @tal@kbin.social avatar

    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.

    Klaymore,
    @Klaymore@sh.itjust.works avatar

    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.

    PlexSheep,
    @PlexSheep@feddit.de avatar

    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)

    PixxlMan,

    Somehow I’ve never considered using git for version controlling/version synchronizing anything other than exclusively code… Brb gonna git all my files.

    Blizzard,

    My $HOME is my castle (・へ・)

    Shrexios,
    @Shrexios@mastodon.social avatar

    @Blizzard @American_Jesus lol love that

    gnutrino,

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

    PseudoSpock,
    @PseudoSpock@lemmy.dbzer0.com avatar

    You still have sd devices? /s

    pivot_root,

    You still have devices?

    I’m over here chilling with my a

    I’d say the only thing I own is the clothes on my back, but those were repossessed yesterday for nonpayment.

    /s

    chaorace,
    @chaorace@lemmy.sdf.org avatar

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

    brunofin,

    /dev/null

    hperrin,

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

    CalcProgrammer1,
    @CalcProgrammer1@lemmy.ml avatar

    I just hard code all config in the source code. If the user really cared, they would recompile from source.

    clearleaf,

    A suckless fan I see

    Eufalconimorph,

    I deliberately run / and /home as tmpfs. Then everything I want to persist across boots gets symlinked in at system start, and anything I didn’t opt in to saving gets deleted every boot.

    hperrin,

    “Developers hate him for this one cool trick.”

    Chobbes,

    A filesystem is just writing to random unused blocks with extra steps.

    elbarto777,

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

    control its* permissions

    6xpipe_,
    @6xpipe_@lemmy.world avatar

    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, (edited )

    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,

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

    clearleaf,

    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.

    murtaza64,

    For the last point, even worse on Mac

    pivot_root,

    It’s not terrible once you learn the muscle memory.

    I’m sure there’s some obscure key bind to go directly there, but I just do Cmd+Shift+G in Finder to get to the browse to path dialog, type ~, and hit return.

    Still a stupid extra amount of work, but at least it’s not having to use my mouse, typing %USERPROFILE%, or having to type the absolute path. That would piss me off even more.

    6xpipe_,
    @6xpipe_@lemmy.world avatar

    I’m sure there’s some obscure key bind to go directly there

    It’s just Cmd+Shift+H (for Home). The shortcuts for many of the most common locations are extremely intuitive.

    • Cmd+Shift+A (Applications)
    • Cmd+Shift+D (Desktop)
    • Cmd+Shift+L (~/Library)
    • Cmd+Shift+C (Computer)
    fartsparkles,

    Finder > Go > Home

    Been that way for decades. Or you can add it to the sidebar by dragging and dropping, or just edit Finder prefs:

    Finder > Preferences > Sidebar

    Microsoft only started showing the Home folder by default in 11 I believe so it’s a pretty common pattern to not reveal the home folder (for some asinine reason).

    First thing I do on any OS is build my own folder structure under my home.

    datavoid,

    It makes me so mad every time I remember my instance is fucking censored

    CoderKat,

    To be honest, pretty much all my files that actually matter are under my Dropbox folder. Everything else is ephemeral. I mostly depend on Steam or the likes to backup game saves. Not much else I care about. I’ve upgraded my PC a few times (with no full backups) and never missed a single thing that got lost in the upgrade.

    Zeth0s,

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

    thesmokingman,

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

    pixelscript,

    Which one?

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • uselessserver093
  • Food
  • [email protected]
  • aaaaaaacccccccce
  • test
  • CafeMeta
  • testmag
  • MUD
  • RhythmGameZone
  • RSS
  • dabs
  • oklahoma
  • Socialism
  • KbinCafe
  • TheResearchGuardian
  • SuperSentai
  • feritale
  • KamenRider
  • All magazines