Shameless plug: I am the author.

      • Samueru@lemmy.ml
        link
        fedilink
        arrow-up
        0
        ·
        4 months ago

        It’s empty lol, it’s a directory on tmpfs that i use to build programs and similar stuff to not be hammering my ssd with unnecessary writes.

        I have $XDG_CACHE_HOME in tmp as well and I moved the mesa sharer caches to $XDG_STATE_HOME as that’s really the only thing so far I’ve needed to preserve.

        • tabular@lemmy.world
          link
          fedilink
          English
          arrow-up
          0
          ·
          edit-2
          4 months ago

          tmpfs (…) to build programs (…) to not be hammering my ssd with unnecessary writes

          Sounds useful. How did you setup the directory?

          Running df tells me “tmpfs” is mounted on /run. If I build in that that directory then would it be stored in RAM, or do I need to do something else?

          • Samueru@lemmy.ml
            link
            fedilink
            arrow-up
            0
            ·
            4 months ago

            I have /tmp in my fstab with these mount options.

            tmpfs /tmp tmpfs rw,noatime,size=20G 0 0

            And the rest of the setup is done in my zprofile

            • tabular@lemmy.world
              link
              fedilink
              English
              arrow-up
              0
              ·
              edit-2
              4 months ago

              I think I should be able to get this working following your zprofile file. Thanks!

    • dizzy@lemmy.ml
      link
      fedilink
      arrow-up
      0
      ·
      4 months ago

      Whoa I’m a stickler for getting as much as I can out but even I have .zshenv and some other too hard to figure out things in there. How’d you manage a total wipeout?

      • Samueru@lemmy.ml
        link
        fedilink
        arrow-up
        0
        ·
        edit-2
        4 months ago

        zsh is actually easy and it is detailed in the archwiki

        You have to set $ZDOTDIR in /etc/zsh/zshenv and iirc that was the only location that required root to edit.

        For the rest of stuff, here is how I fix steam for example and you can check the rest of my dotfiles for how I configured zsh and all of that.

        Although I haven’t updated them, I still had a .local directory back then, it was 1 week ago that I changed .local for Local and that let to an issue with distrobox which I made a PR fixing it that’s still open though.

    • hallettj@leminal.space
      link
      fedilink
      English
      arrow-up
      0
      ·
      4 months ago

      Are there other relevant standards? The XDG base directory specification has been around for a long time, and is well established.

      Maybe your comment wooshed over my head; if so I apologize.

        • tabular@lemmy.world
          link
          fedilink
          English
          arrow-up
          0
          ·
          4 months ago

          To conform to a standard or do something else are each a choice. If you can justify your choice then perhaps it’s a good one.

        • Deckweiss@lemmy.world
          link
          fedilink
          arrow-up
          0
          ·
          4 months ago

          Well, when software supports this standard, you as a user have a way to not confirm to it by setting the env variables to whatever you want, even per app. So you have two choises, either use it as is or change it.

          But if software doesn’t supportthe spec, there is no choise of using it. So ons choise less.

    • chip@feddit.rocks
      link
      fedilink
      arrow-up
      0
      ·
      4 months ago

      Choice, huh? I can’t choose where the config files are stored unless I am willing to either dig into an obscure setting, modify the source code and recompile (repeat every time there’s an update), or contact the developer’s smug beard using smoke signals.

  • davel@lemmy.ml
    link
    fedilink
    English
    arrow-up
    0
    ·
    4 months ago

    This would just further complicate things for me. It assumes that 1) the system even has a windowing system/desktop environment or 2) all the installed software is XDG-aware. Most of the time I’m fiddling with headless environments.

    • Eager Eagle@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      edit-2
      4 months ago

      The spec doesn’t make those assumptions at all, idk where that’s coming from.

      I have headless machines with XDG vars configured and ones without them. XDG compliant software works in either case, but I’m less likely to use a piece of software that clutters my $HOME.

    • exu@feditown.com
      link
      fedilink
      English
      arrow-up
      0
      ·
      4 months ago

      It’s not too hard to check for XDG support first and use a few hardcoded directory paths if that is unavailable.

      • davel@lemmy.ml
        link
        fedilink
        English
        arrow-up
        0
        ·
        4 months ago

        It’s even easier to ignore it altogether, which is what I do. I don’t use “a few” non-XDG-aware things; I use lots an lots of them.

        • hallettj@leminal.space
          link
          fedilink
          English
          arrow-up
          0
          ·
          4 months ago

          Are you saying that you don’t want to write your software according to the XDG spec, or that you don’t want to set the XDG env vars on your system? If it’s the second that’s fine - apps using XDG work just fine if you ignore it. If it’s the first I’d suggest reconsidering because XDG can make things much easier for users of your software who have system setups or preferences that are different from yours; and using XDG doesn’t cause problems for users who ignore it.

          OP’s recommendation is aimed mostly at software authors.

          • davel@lemmy.ml
            link
            fedilink
            English
            arrow-up
            0
            ·
            4 months ago

            I meant the second. But as to the first: I generally write in-house software for headless server environments, and my peers are going to push back if I add irrelevant XDG foo to my PR.

    • hallettj@leminal.space
      link
      fedilink
      English
      arrow-up
      0
      ·
      4 months ago

      So yes, “XDG” stands for “Cross-Desktop Group” - but I don’t agree that using the spec assumes a windowing system. The base directory spec involves checking for certain environment variables for guidance on where to put files, and falling back to certain defaults if those variables are not set. It works fine on headless systems, and on systems that are not XDG-aware (I suppose that means systems that don’t set the relevant env vars).

      OTOH as another commenter pointed out the base directory spec can make software work when it otherwise wouldn’t on a system that doesn’t have a typical home directory layout or permissions.

  • aard@kyu.de
    link
    fedilink
    arrow-up
    0
    ·
    4 months ago

    Probably half the entries in that list are not GUI apps, and XDG doesn’t apply (though some still support it). For some others there (like emacs) XDG is used if it exists.

    • Eager Eagle@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      4 months ago

      XDG doesn’t apply for CLI apps? About half of dirs I still have cluttering my home are GUI apps whose devs refuse to follow the specification, while I see less friction from CLI/TUI devs, since they’re the ones actually seeing these hidden locations.

      • aard@kyu.de
        link
        fedilink
        arrow-up
        0
        ·
        4 months ago

        It’s already in the name - XDG stands for X Desktop Group (nowadays freedesktop), which works on interoperability for desktop environments. In a pure shell environment (or even if you’re not running a full desktop) none of the XDG variables are defined, and especially in shell environments the default fallbacks specified by XDG are not necessarily what the operator would expect.

        • sparr@lemmy.world
          link
          fedilink
          English
          arrow-up
          0
          ·
          4 months ago

          That name is decades old. XDG stands for “Cross Desktop Group”.

          A “pure” X environment (e.g. startx xterm) also doesn’t define those variables, but many desktop environments do, just like many shell configurations do.

  • wvstolzing@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    4 months ago

    vim now has an option to put the .vim folder in ~/.config; though I’m not sure if the default plugin/package & syntax folders can be set under ~/.local/share.

  • dohpaz42@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    4 months ago

    Here is a more concise way to achieve the same thing:

    ls -ACd ~/.??*/ | sed -e "s#$HOME/##g"
    
    • Samueru@lemmy.ml
      link
      fedilink
      arrow-up
      0
      ·
      4 months ago

      ls -A | grep "^\."

      I had to make a dummy .dotfile to test because I don’t have hidden files in my home.

    • palordrolap@kbin.run
      link
      fedilink
      arrow-up
      0
      ·
      4 months ago

      I think that can be boiled down to only cd; echo .*/

      Maybe throw a ;cd - on the end if the change of directory is unwanted.

  • MonkderDritte@feddit.de
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    4 months ago

    Where did i read this… basically, the .file being hidden being a bug in the early unix filesystem, which got misused to hide configuration files.

    Offenders despite XDG-variables set and with no workaround:

    • .android: hardcoded in adb and i guess something in mtp too
    • .pki: some tool/library Firefox and Chromium sometimes use.
    • .steam: yes, that

    Btw, https://wiki.archlinux.org/title/XDG_Base_Directory

  • Wispy2891@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    4 months ago

    100% agree and I also despise devs who do this on windows, instead of using %appdata% they’re using c:\users\username\.myappisimportantandtotallydeservesthisdir

    • Tlaloc_Temporal@lemmy.ca
      link
      fedilink
      arrow-up
      0
      ·
      4 months ago

      To be fair here, appdata is technically a hidden folder and there are lots of reasons an app would want it’s data accessable by the user.

      • Wispy2891@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        4 months ago

        Yes but then just spam the documents folder like anyone else, don’t hoard the home root for no reason except that is a lazy cross platform port

    • conorab@lemmy.conorab.com
      link
      fedilink
      arrow-up
      0
      ·
      4 months ago

      I think that also causes issues for roaming profiles and folder redirection. If roaming is turned on then everything in the %appdata%\roaming folder is synced to a server. %AppData%\Local is not. So if your app is using %AppData%\Roaming for temporary data then you are causing a whole bunch on unnecessary IO. Same for using Documents since that if often synced.

    • xan1242@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      0
      ·
      4 months ago

      Not to mention - this isn’t necessarily the correct place for Windows anyway. That is exactly why they standardized stuff around Vista.

      Plus - what about apps that store an ungodly amount data in there? Personally, I only keep the OS and basic app data (such as configs and cache) on the partition and nothing else.

      Then something like Minecraft comes along and it’s like “humpty dumpty I’m crapping a lumpty” and stores all its data in “.minecraft” right there in your user directory.

      Then you gotta symlink stuff around and it becomes a mess…

  • sfera@beehaw.org
    link
    fedilink
    arrow-up
    0
    ·
    4 months ago

    Are there abstractions available around the XDG specifications to resolve the proper paths?

    • MonkderDritte@feddit.de
      link
      fedilink
      arrow-up
      0
      ·
      edit-2
      4 months ago

      What language? Python has PyXDG.

      In shell it’s simply

      XDG_DATA_HOME="${XDG_DATA_HOME:-"$HOME"/.local/share}"
      XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-"$HOME"/.config}"
      etc.
      
      • sfera@beehaw.org
        link
        fedilink
        arrow-up
        0
        ·
        4 months ago

        Thanks, I did not know about PyXDG. That was the type of thing I was asking about.

      • sfera@beehaw.org
        link
        fedilink
        arrow-up
        0
        ·
        4 months ago

        I do. But you might have misunderstood my question. I was not asking for assistance. I was just curious if there are libraries available which allow easy adoption of the XDG specification. I imagine that such abstractions would be useful for multi-platform software and generally to lower the bar for adoption.

        • dan@upvote.au
          link
          fedilink
          arrow-up
          0
          ·
          4 months ago

          Depends on the programming language. In C# for example, there’s an API to get special folder paths that works in all supported environments (Windows, Linux, MacOS, Android, and I think iOS too). On Linux, it includes fallbacks in case the environment variables aren’t set.

  • dinckel@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    4 months ago

    Golang puts shit specifically in $HOME/go. Not even .go. Just plain go.

    Why is it so difficult to follow industry standards

      • dinckel@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        4 months ago

        Of course, but that’s not the point. There should be a sane default, and there isn’t one

        • Laser@feddit.org
          link
          fedilink
          arrow-up
          0
          ·
          4 months ago

          It makes it insofar better to me that you have the option to change it. You can’t change Mozilla programs to use anything but .mozilla (apart from modifying the source code of course) so for me seeing the folder is at least a way of telling me that the variable is unset.

          The better question is which folder is suited the best to store the stuff that goes into $GOPATH

          • fmstrat@lemmy.nowsci.com
            link
            fedilink
            English
            arrow-up
            0
            ·
            4 months ago

            Just because something is worse, doesn’t make the other thing good. A sane and standard default, as others have mentioned, is a small bar to meet.

    • atzanteol@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      0
      ·
      edit-2
      4 months ago

      Go pisses me off with that. I separate projects the way I want but go wants every project written in go in one big directory?

      • dinckel@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        4 months ago

        I really didn’t like this either. It’s quite surprising, because the rest of Go tooling is quite nice. Not having a venv, or at least something like pnpm-style node_modules is weird

        • jollyrogue@lemmy.ml
          link
          fedilink
          arrow-up
          0
          ·
          4 months ago

          Why would go have a virtual environment or dep tree like node_modules equivalent, it’s not interpreted or dynamically linked.

          With modules, dependencies can be vendored.

    • Eager Eagle@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      4 months ago

      off the shelf go was too annoying for me

      Nowadays I set GOENV_ROOT to an XDG location and use goenv instead.

    • dan@upvote.au
      link
      fedilink
      arrow-up
      0
      ·
      4 months ago

      tbh I don’t think that’s too bad… I feel like too many things are hidden that shouldn’t be hidden

      • WolfLink@sh.itjust.works
        link
        fedilink
        arrow-up
        0
        ·
        4 months ago

        What I want in $HOME are the following directories:

        If I’m on a GUI-based environment:

        • Desktop
        • Documents
        • Downloads

        In general:

        • .local
        • my_junk_folder_i_made

        I’d like everything else to live within something like ~/.local thanks

        • dan@upvote.au
          link
          fedilink
          arrow-up
          0
          ·
          edit-2
          4 months ago

          Maybe Linux should have .local and .roaming folders like Windows. local = only useful on this system, roaming = good to sync across systems. Config would be in .roaming if it’s not machine-specific.

            • dan@upvote.au
              link
              fedilink
              arrow-up
              0
              ·
              4 months ago

              There’s some stuff in~/.config that’s specific to the computer. KDE is a good example - a lot of KDE apps mix config and state in the same file. There’s some solutions for syncing these files, like https://github.com/VorpalBlade/chezmoi_modify_manager which is an addon to Chezmoi that can exclude particular INI-style keys.

              I’m sure there’s some config files in there that are entirely specific to the computer.

              There’s also things like data files that you may want to keep in sync across machines. They’re not really configs.

          • rotopenguin@infosec.pub
            link
            fedilink
            English
            arrow-up
            0
            ·
            4 months ago

            The only practical difference between Local and Roaming and LocalLow is that developers randomly pick one and dump your game saves in there.

          • jollyrogue@lemmy.ml
            link
            fedilink
            arrow-up
            0
            ·
            4 months ago

            There is a .local folder these days.

            Profile roaming hasn’t been solved aside from NFS mounts. I guess Syncthing might work.