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

Applications symlinks and multi-users? #11584

Closed
Yann-R opened this issue Jun 4, 2015 · 9 comments
Closed

Applications symlinks and multi-users? #11584

Yann-R opened this issue Jun 4, 2015 · 9 comments

Comments

@Yann-R
Copy link

Yann-R commented Jun 4, 2015

I was wondering how to correctly make use of homebrew-cask on a system used by several users.

  • For homebrew, that's simple: one user (that might be considered as "admin" here for simplification) can install the binaries for all the users. By default, nothing special is added to his own environment, and all the binaries are shared (via automatically created symlinks) in the global homebrew bin directory. It's intrinsically muti-users.
  • For homebrew-cask, there is a little (but important) difference: By default, automatically created symlinks are made available in his personal ~/Applications folder. It's intrinsically far less multi-users.

There might be plenty of way to workaround this point (install to another global directory, make symlinks yourself one by one in your ~/Application of another user, etc.). But to mix the current simplicity of use given by homebrew cask, and the really nice potential (of selection/deletion) given by personal symlinks in ~/Applications, would it be possible to think of a new command?

inspired from brew link command, it could be brew cask userlink:

  • with no args, links all installed Casks to your personnel Application folder;
  • given installed Casks, links only these Casks.

Maybe possible?

@fanquake fanquake added enhancement awaiting maintainer feedback Issue needs response from a maintainer. labels Jun 4, 2015
@vitorgalvao
Copy link
Member

In the future, apps will be linked to /Applications. You can also do it now by issuing --appdir.

Please consult the documentation for details.

@Yann-R
Copy link
Author

Yann-R commented Jun 4, 2015

You can also do it now by issuing --appdir

Yes, as I said above: "install to another global directory"...

But I wanted to avoid that solution because, as explained in the following lines above: placing the symlinks (we are not speaking of the applications themselves) not in the personal folder looses the nice potential of selection/deletion (of symlinks) on a per-user basis, which is far more user-friendly to give each user a part of customization for determining the apps he find useful in his environment.

That's why, though it's a compromise, symlinking directly in /Applications would not get my preference if I had alternatives :-)

@jawshooah
Copy link
Contributor

I'm confused, how does --appdir not solve your problem? You want the ability to selectively install symlinks into each user's ~/Applications directory, which is exactly the facility that --appdir provides.

If you would like to change the default behavior per-user, you could add the following to /etc/bashrc for root:

export HOMEBREW_CASK_OPTS='--appdir=/Applications'

And then add the following to each user's ~/.bashrc:

export HOMEBREW_CASK_OPTS='--appdir=~/Applications'

@Yann-R
Copy link
Author

Yann-R commented Jun 4, 2015

I must have been unclear, please forgive me, I'll try to reformulate.

Even if --appdir provides something interesting (as well as the forecoming solution that would install symlinks in /Applications), this is not the kind of result I would love since they represent a global and unique "big folder" and not a solution for each user to "customize" his own useful symlinks to applications installed in the Caskroom.

Consider this following scenario in a home with several users:

  1. The father uses homebrew-cask to easily install (and stay aware of the updates) a lot of apps (libreoffice among them), all providing a symlinks installed in a location HE likes. (default or using --appdir).
  2. Afterwards, one other user is interested to use some of these available applications from the Caskroom. To make his life easier he would like to get symlinks in his own environment, but only the ones he needs... Not the whole pack that is useless for him.
    At this moment this second user could think of invoking brew cask install libreoffice (with --appdir or not) but the current behavior of this command is to answer A Cask for libreoffice is already installed. Add the "--force" option to force re-install.

Then my conclusion is:

  • what a pity, brew cask install libreoffice could just symlinks the app when it's already downloaded and present in the Caskroom, so my users could easily benefit from some of the applications I already installed, without cluttering their environment with the full list of the installed software for everyone.

Then my wish is:

  • could another option exist in brew cask, a bit working like brew linkapps, just to create the symlinks of already installed apps where I want?

P.S. The "inspiring" brew command:

brew linkapps [--local] [formulae]
              Find  installed formulae that have compiled .app-style "applica-
              tion" packages for OS X, and symlink those apps  into  /Applica-
              tions, allowing for easier access.

              If  no  formulae are provided, all of them will have their .apps
              symlinked.

              If provided, --local will move them into the  user's  ~/Applica-
              tions  folder  instead  of  the system folder.

@jawshooah
Copy link
Contributor

Ah, I see what you mean. That would indeed be a very nifty feature. Just have multiple symlinks pointing back to the same Cask rather than having separate installations per user.

@vitorgalvao
Copy link
Member

To be blunt, there is no value in implementing the feature, at this time. Linking the regular way, with ln -s, is just as effective and is also a single command.

You might argue that is slightly more inconvenient since you have to use the full path down to the version number, and you’d be right. However (and this is why I said “at this time”), we currently can’t even correctly keep track of what you have installed, which means this feature is simply unfeasible, as of now.

I’ll keep this closed. Further down the line, when the issues preventing this are solved, we may think about revisiting this.

@Yann-R
Copy link
Author

Yann-R commented Jun 4, 2015

Ah, I see what you mean. That would indeed be a very nifty feature. Just have multiple symlinks pointing back to the same Cask rather than having separate installations per user.

@jawshooah Yes, I must be wrong but I thought it was the underlying "spirit" of homebrew-cask:

  • the (shared) repository in the Caskroom
  • each user symlinking his applications to the Caskroom (by default in personal ~/Applications)

@vitorgalvao
OK, I understand the difficulty you explained and the drawbacks you mentioned.
I nevertheless regret choosing in the future to move all this to a global /Applications, which implies to have everything flat with plenty of apps for all the users, exactly what annoys me with the App Store.

I guess the behavior of existing brew linkapps may have the same technical drawbacks, but the same advantages: do what it can do at the moment the user invoke it and automatically place something like ln -s would manually do.
It's also true it did not appear in brew from start, so I'll keep waiting, as you said maybe one day it will be possible :-)
Thanks for your time to answer me. Much appreciated.

@vitorgalvao
Copy link
Member

each user symlinking his applications to the Caskroom (by default in personal ~/Applications)

That was never a goal, that I recall.

I nevertheless regret choosing in the future to move all this to a global /Applications

It’ll take a while to happen, since there is lacking a transition plan, but the decision is made. Most users link there anyway with --appdir, so it makes sense to make it the default. You have nothing to worry, though: don’t like it, just do the reverse. Only the default is changing, not the functionality.

@Yann-R
Copy link
Author

Yann-R commented Jun 4, 2015

That was never a goal, that I recall.

That's why I was wrong ;-)
But that's why I regretted it to be not as multi-user oriented as I would have imagined and opened this suggestion.

I'll keep watching to the future evolutions.
Regards.

@adidalal adidalal removed the awaiting maintainer feedback Issue needs response from a maintainer. label Apr 12, 2016
@Homebrew Homebrew locked and limited conversation to collaborators May 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants