Shameless plug: I am the author.

  • dinckel
    link
    fedilink
    11910 months ago

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

    Why is it so difficult to follow industry standards

        • @[email protected]
          link
          fedilink
          1310 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
            link
            fedilink
            English
            710 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.

      • dinckel
        link
        fedilink
        2010 months ago

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

    • @[email protected]
      link
      fedilink
      English
      13
      edit-2
      10 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
        link
        fedilink
        210 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

        • @[email protected]
          link
          fedilink
          110 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.

          • dinckel
            link
            fedilink
            110 months ago

            Obviously it’s not, but you have to download all this shit somewhere before compilation. That’s the whole point

    • Eager Eagle
      link
      fedilink
      English
      510 months ago

      off the shelf go was too annoying for me

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

    • PureTryOut
      link
      fedilink
      1110 months ago

      Strange that some apps allow configuring it rather than just doing it automatically…

      • @[email protected]
        link
        fedilink
        19 months ago

        That’s the usual open source way. The config probably came later so they just added the option without changing the default because that would break backward compatibility.

        And there would be too much boring work to build a migration.

    • @[email protected]
      link
      fedilink
      English
      110 months ago

      After running it and properly configure the paths I once again came to the conclusion: I fucking hate Google.

  • @[email protected]
    link
    fedilink
    38
    edit-2
    10 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

    • @[email protected]
      link
      fedilink
      310 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.

    • @[email protected]
      link
      fedilink
      310 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…

    • Tlaloc_Temporal
      link
      fedilink
      110 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.

      • @[email protected]
        link
        fedilink
        810 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

  • @[email protected]
    link
    fedilink
    2610 months ago

    I didn’t know about this (and thankfully, haven’t written anything public). I’ve been trying to fix an install script for an OSS project that doesn’t work on immutable distros, and using the XDG Base Directory specs might just be the panacea I was looking for!

  • @[email protected]
    link
    fedilink
    22
    edit-2
    10 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

  • dohpaz42
    link
    fedilink
    English
    1410 months ago

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

    ls -ACd ~/.??*/ | sed -e "s#$HOME/##g"
    
    • palordrolap
      link
      fedilink
      5
      edit-2
      10 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.

  • davel [he/him]
    link
    fedilink
    English
    1110 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.

    • exu
      link
      fedilink
      English
      2510 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 [he/him]
        link
        fedilink
        English
        710 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
          link
          fedilink
          English
          2410 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 [he/him]
            link
            fedilink
            English
            210 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
      link
      fedilink
      English
      2410 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.

    • Eager Eagle
      link
      fedilink
      English
      11
      edit-2
      10 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.

    • hallettj
      link
      fedilink
      English
      1510 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.

        • @[email protected]
          link
          fedilink
          1210 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.

          • @[email protected]
            link
            fedilink
            2
            edit-2
            10 months ago

            And if I don’t agree with how that standard is implemented? I should have the choice to use something else. Isn’t that how everything works?

            • @[email protected]
              link
              fedilink
              110 months ago

              You can of course not give users a choice. And a lot of applications do their own thing, having their own variables like GOPATH or a cli option like --config or some way to do that in a config file like Idea IDEs. But implementing XDG from start is miles simpler for all parties, it’s good practice to have your paths and variables somewhat organized in code anyway.

        • @[email protected]
          link
          fedilink
          English
          110 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.

    • @[email protected]
      link
      fedilink
      810 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.

  • Mactan
    link
    fedilink
    1010 months ago

    there’s no place like 127.0.0.1

    there’s no place like XDG_CONFIG_HOME.

  • aard
    link
    fedilink
    610 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
      link
      fedilink
      English
      910 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
        link
        fedilink
        210 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.

        • @[email protected]
          link
          fedilink
          English
          210 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
    link
    fedilink
    510 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.

    • @[email protected]
      link
      fedilink
      110 months ago

      You can also just use neovim instead, among other improvements, it’s configs are in the xdg dirs

  • The Doctor
    link
    fedilink
    English
    510 months ago

    BRB, putting in a PR to make /etc mode 1777 by default.