Comments (19)
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
from homebrew-cask.
Better yet, we could use appify (or port it to Ruby) to create .app
s 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.
Hm. I like that! 👍
Might be helpful to port to ruby, and then we could probably grab the icon somehow too
from homebrew-cask.
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?
It shows up in Spotlight just fine, and launching it from there works!
from homebrew-cask.
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.
Hey @passcod, I don't suppose the code for the appify port is on github?
from homebrew-cask.
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.
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.
Wow magic prefix! This is cool. Definitely simpler and Homebrew-supported == free work :)
from homebrew-cask.
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.
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.
Nice!
cc @cunnie Does that solve the use-case satisfactorily?
from homebrew-cask.
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.
++
Seems important @passcod
from homebrew-cask.
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.
@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.
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.
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.
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)
- devtunnel SHA not matching HOT 1
- TeXstudio for Apple Silicon has been released. HOT 1
- Package upgraded without a matching checksum when `--require-sha` is set HOT 1
- ngrok 3.8.0 cask is empty - missing binary HOT 1
- False positive in `brew outdated --cask --greedy` and unnecessary reinstall in `brew upgrade chromium` even if installer is already downloaded HOT 8
- An error occurred when I installed tencent-meeting. Please fix it HOT 1
- McGimp's plugin can still be used with current GIMP. HOT 2
- Should the Ghidra cask be removed due to quarantine issues? HOT 14
- Beekeeper Studio formula tries to install non-existing release. HOT 2
- powershell caveats not reproducible HOT 2
- 404 when installing 'banksiagui', and can't update it with `brew bump` HOT 1
- Uninstalling via `remove --cask --force obs` then `autoremove` and `cleanup ` still leave leftovers `/obs-studio/` and crap in `/SystemExtensions/` HOT 3
- Cask for Evernote is not up to date HOT 2
- Error upgrading `vnc-viewer` cask HOT 8
- Casks with Sparkle/Electron and no auto_update HOT 4
- Casks with `:extract_plist` livecheck strategy HOT 1
- Alfred can't find any of the homebrew casks i installed, even with folder added HOT 3
- brew uninstall --cask mactex fails HOT 2
- update(blackhole-2ch): kickstart "com.apple.audio.coreaudiod" Operation not permitted HOT 14
- Cloudflare-Warp not able to update anymore HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from homebrew-cask.