Giter Club home page Giter Club logo

Comments (19)

patcon avatar patcon commented on May 18, 2024

I can't remember whether this was brought up anywhere, but finder aliases will still show up in spotlight, albeit as "Documents". If this is worth pursuing, then aliases can be created programmatically through applescript, which can be run from a single terminal command:

http://macstuff.beachdogs.org/blog/?p=37
http://hints.macworld.com/article.php?story=20010427022452992

/cc @mkocher @cunnie

from homebrew-cask.

passcod avatar passcod commented on May 18, 2024

Better yet, we could use appify (or port it to Ruby) to create .apps that launch (instead of link to) the application (which could stay in the Cellar). I believe this is the strategy used by Steam :)

from homebrew-cask.

patcon avatar patcon commented on May 18, 2024

Hm. I like that! 👍

Might be helpful to port to ruby, and then we could probably grab the icon somehow too

from homebrew-cask.

passcod avatar passcod commented on May 18, 2024

OK, I ported it to ruby in its own Gem: https://rubygems.org/gems/appify
An integration (using #114) could look like this:

require 'appify'

app = Appify::App.new
app.run = "#!/bin/bash\nopen #{cask.destination_path}/#{file}.app"
app.write Cask.appdir.join "#{file}.app"
# done.

I might just improve the gem a bit so it can support adding and reading custom metadata (so we can manage the cask aliases more effectively) and icons (everybody loves pretty shiny things). But, just yet, as a proof-of-concept, it doesn't look too bad, huh?

Screen Shot 2012-12-14 at 11 16 22 PM
It shows up in Spotlight just fine, and launching it from there works!

from homebrew-cask.

patcon avatar patcon commented on May 18, 2024

Nice!! This is effin awesome. I could kiss you @passcod, if there wasn't all this internet between us! Count your lucky stars

from homebrew-cask.

patcon avatar patcon commented on May 18, 2024

Hey @passcod, I don't suppose the code for the appify port is on github?

from homebrew-cask.

passcod avatar passcod commented on May 18, 2024

It's not, actually. You can get at it by expanding the gem... it's in a git repo on my home box, I'll push it up this afternoon.

from homebrew-cask.

phinze avatar phinze commented on May 18, 2024

Oh I stumbled across a simpler and potentially cleaner solution to this the other day.

Homebrew recently incorporated code to make a "Finder alias" when linking, which allows spotlight to find apps properly.

https://github.com/mxcl/homebrew/pull/14821/files

Seems simple enough to suit our needs. I was going to give it a shot this week. Thoughts?

from homebrew-cask.

passcod avatar passcod commented on May 18, 2024

Wow magic prefix! This is cool. Definitely simpler and Homebrew-supported == free work :)

from homebrew-cask.

patcon avatar patcon commented on May 18, 2024

Haven't tested yet, but appears that Aliases alone might not solve the spotlight launching issue:
https://github.com/pivotal/pivotal_workstation/issues/97#issuecomment-10055718
http://apple.stackexchange.com/questions/23653/can-i-make-a-symlink-to-a-app-folder-in-applications-directory-show-up-in-spo/32495#32495

from homebrew-cask.

phinze avatar phinze commented on May 18, 2024

Just tested locally, Works for me ™️

More specifically, I tried:

osascript -e 'tell application "Finder" to make alias file to POSIX file "/usr/local/Cellar/iterm2/1.0.0.20120203/iTerm.app" at POSIX file "/Applications/"'

And:

osascript -e 'tell application "Finder" to make alias file to POSIX file "/usr/local/Cellar/caffeine/1.1.1/Caffeine.app" at POSIX file "/Applications/"'

Spotlight has them showing up under "Documents", but selecting them does indeed launch.

from homebrew-cask.

patcon avatar patcon commented on May 18, 2024

Nice!

cc @cunnie Does that solve the use-case satisfactorily?

from homebrew-cask.

passcod avatar passcod commented on May 18, 2024

I remembered (late, huh) to push appify. (for @patcon). Also, the advantage of appify over the magic number is that it appears under Applications in Spotlight. Just thought I'd mention that.

from homebrew-cask.

patcon avatar patcon commented on May 18, 2024

++
Seems important @passcod

from homebrew-cask.

fbeeper avatar fbeeper commented on May 18, 2024

Hi there! I've been using this rudimentary AppleScript as a workaround to make the aliases to all my Cask apps:
https://github.com/fbeeper/fBootstrap/raw/master/sw/myCaskLinkApps.scpt
It works 👍 but it is not the nicest solution ever :P

I just wonder...
Are you planning officially include the aliases via the linkapps function like Homebrew did?
Anytime soon? May I help somehow?

from homebrew-cask.

patcon avatar patcon commented on May 18, 2024

@phinze can we get a reply on your thoughts about finder aliases (via applescript) vs "real" apps (appify). It seems spotlight will show finder aliases as "documents" whereas appify converts them to something that is recognized as "Applications".

Is this not a reason to use appify? I can understand if you think it deserves a new issue for the enhancement, but wondering if you think it's a valid concern. (I believe apps show up first in spotlight.) Thanks.

from homebrew-cask.

phinze avatar phinze commented on May 18, 2024

Sorry @patcon - I've been doing a lot of hacking this past week but I should have been writing more about it. :)

I set out this last week to get this issue solved once and for all:

I spent some time trying to get the appify strategy up and running consistently, and for the life of me I could not get it to work. I consistently got the PowerPC error [1]. So I turned my attention to the Finder Alias strategy, which I had success with (albeit with the Document caveat). I spent a buttload of time fighting the AppleScript layer - which seems to be the only reliable way to get OS X to create Finder Aliases.

So I have a working implementation of that on my branch, but the behavior is being so finicky that I don't feel comfortable merging it [2].

Now I have one more path I stumbled on along the way. I recently switched to Boxen on my laptop, which moves the Homebrew tree under /opt/boxen - and magically my Caskroom apps started showing up in Spotlight!

So I'm going to try on another branch simply moving the Caskroom to /opt/homebrew-cask/Caskroom to see if that works, and we'll have another potential solution to discuss.

We'll beat this issue soon I swear! 👊

[1] Reported here https://gist.github.com/mathiasbynens/674099/#comment-592022 and several other places
[2] Have a look at this and cry: https://github.com/phinze/homebrew-cask/blob/get-travis-passing/lib/cask/app_linker.rb#L43-L72

from homebrew-cask.

patcon avatar patcon commented on May 18, 2024

So I'm going to try on another branch simply moving the Caskroom to /opt/homebrew-cask/Caskroom to see if that works, and we'll have another potential solution to discuss.

Oh man, I apologize if I seemed ungrateful for all the work you've done one this -- I've been totally MIA from pivotal_workstation/homebrew-cask lately, so I do appreciate it! Hey, I don't suppose you have a bitcoin wallet that I could tip?

Regardless, thanks for the update!

from homebrew-cask.

phinze avatar phinze commented on May 18, 2024

Hey hey hey! Things are finally looking okay! Check out #188 and say what you have to say!

@patcon no worries whatsoever. i've been wanting to try out bitcoin! i set up a thing here http://phinze.com/bitcoin

from homebrew-cask.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.