xdg-ninja is a shell script that checks for unwanted files and directories in the user’s home directory and suggests moving them to an appropriate location. The script uses a configuration file that contains rules for identifying unwanted files and directories. The configurations are from the arch wiki page on XDG_BASE_DIR, antidot, and contributions from other users. The script can be run manually by cloning the repository and running the xdg-ninja.sh script or installed with Homebrew. Optional dependencies include glow for rendering Markdown in the terminal. The script is available on GitHub. The tool has been discussed on Reddit and Hacker News.

  • PoorPocketsMcNewHold@lemmy.ml
    link
    fedilink
    English
    arrow-up
    7
    ·
    1 year ago

    If you want something a little easier to install, and especially, allow fixing a couple of those issues safely, and automatically, you can try antidot .

    xdg-ninja do already use the antidot rules natively, it’s mostly for those who don’t want to manually do the safest/easiest of fixes. It should be safe to use alongside xdg-ninja.

  • jack@monero.town
    link
    fedilink
    arrow-up
    4
    ·
    1 year ago

    Pro tip: Create a new dir inside your home dir that you use as if it was your home dir. Never worry about programs shitting in your personal space again.

    • merthyr1831@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      As someone who uses a Mac for work, I simply prefer to let MacOS do its thing in case I make it angry. The file system might as well be magic the way its somehow identical and totally different to Linux/Unix

  • Turbo@lemmy.ml
    link
    fedilink
    arrow-up
    3
    arrow-down
    2
    ·
    1 year ago

    I’m not understanding why we don’t want some config files in our home dir

    Where else would we put them and why would I want to have to back then all up from different places?

    Thx

    • why would I want to have to back then all up from different places?

      That’s the point, putting them all in ~/.config and a bunch of other common places makes backups easy. My home directory is filled with XDG incompliant dotfiles but also with some Xorg logs, a bunch of session tokens, a few hidden directories that seem to be used for cache, and some other stuff I don’t really want to be part of my config backup like the Flatpak .var store.

      With XDG, you’re free to set your config path to $HOME if you’d like. I’d like programs to stick to ~/.config, ~/.csche, and ~/.local for config, cache, and application storage.

      • Turbo@lemmy.ml
        link
        fedilink
        arrow-up
        3
        ·
        1 year ago

        Okay, got you. Thanks. Maybe I’m just use to it, and selectively backup stuff from my home without doing a full sync.

        Thanks for the answer.

    • cdombroski@programming.dev
      link
      fedilink
      English
      arrow-up
      4
      ·
      1 year ago

      Typically xdg-ninja will tell you how to set things up so as many dot files and directories as possible end up in the correct xdg location instead of cluttering up the top level of your home directory.

  • venusenvy47@reddthat.com
    link
    fedilink
    arrow-up
    2
    arrow-down
    1
    ·
    1 year ago

    It talks about installing with nix package manager. I’ve never heard of this one. Can anyone comment on how well nix would work foru Ubuntu installations? It sounds like it installs some daemon, which I haven’t heard before from a package manager.