Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: Include XDG_BIN_HOME #95

Open
Samueru-sama opened this issue Oct 9, 2024 · 6 comments
Open

Request: Include XDG_BIN_HOME #95

Samueru-sama opened this issue Oct 9, 2024 · 6 comments

Comments

@Samueru-sama
Copy link

As the title says, add the option to check for $XDG_BIN_HOME and if it is not defined a default of $HOME/.local/bin is returned.

While XDG_BIN_HOME is not technically in the spec, it is used by thousands of applications already and is mentioned on the NixOS wiki

@xplshn
Copy link

xplshn commented Oct 9, 2024

Would be very much appreciated for https://github.com/xplshn/aisap

@adrg
Copy link
Owner

adrg commented Oct 10, 2024

@Samueru-sama @xplshn That seems like a good addition to the library.

However, I need to find suitable defaults for macOS and Windows, as all paths provided by the package define defaults for all operating systems.

  • For Windows, the default path would be the FOLDERID_UserProgramFiles known folder which defaults to %LOCALAPPDATA%\Programs.
  • For macOS I'm thinking either $HOME/bin or $HOME/.local/bin. Both are non-standard but /usr/local/bin, where users seem to be encouraged to place their binary files is common to all users and it's not located in the user's home directory as the $XDG_BIN_HOME environment variable suggests.

@xplshn
Copy link

xplshn commented Oct 10, 2024

And let's not forget Plan 9, which has /usr/$user/bin :)

@adrg
Copy link
Owner

adrg commented Oct 10, 2024

And let's not forget Plan 9, which has /usr/$user/bin :)

That should be equivalent to $home/bin right? Because that's what I was thinking of using for Plan 9.

@xplshn
Copy link

xplshn commented Oct 11, 2024

And let's not forget Plan 9, which has /usr/$user/bin :)

That should be equivalent to $home/bin right? Because that's what I was thinking of using for Plan 9.

Yes, I'm on 9front and most people usually put the executables there :)
But on plan 9 we can have subdirectories in the dirs of our "path" (not really, we don't have a $PATH, it works in a different manner)

@adrg
Copy link
Owner

adrg commented Oct 11, 2024

Yes, I'm on 9front and most people usually put the executables there :) But on plan 9 we can have subdirectories in the dirs of our "path" (not really, we don't have a $PATH, it works in a different manner)

Great, then $home/bin it is. I ran Plan 9 in a virtual machine when I first added support for it to get a feel of where things are supposed to go.

So we got Linux, Windows and Plan 9 covered.
For macOS, I'm not sure. I'm leaning towards $HOME/.local/bin for consistency and the fact that at least it's a hidden directory. From what I can tell Neovim is already using that directory on macOS (https://superuser.com/questions/1692493/what-is-local-folder-in-mac-os-used-for).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants