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

Programmatically modify Alfred scope #18

Closed
kortina opened this issue Sep 26, 2012 · 9 comments
Closed

Programmatically modify Alfred scope #18

kortina opened this issue Sep 26, 2012 · 9 comments

Comments

@kortina
Copy link

kortina commented Sep 26, 2012

You could have an option to programmatically edit the Alfred scope by doing the following:

defaults read com.alfredapp.Alfred scope.paths | grep -q /usr/local/Cellar || defaults write com.alfredapp.Alfred scope.paths -array-add "/usr/local/Cellar"

NB: I don't know how to make Alfred see this change without restarting Alfred.

@phinze
Copy link
Contributor

phinze commented Sep 27, 2012

Great idea! Going to build this in soon - maybe a 'brew cask linkalfred' command.

Probably no harm in programmatically bouncing Alfred for you while we're at it, eh? Will investigate this when testing.

@ghost
Copy link

ghost commented Oct 9, 2012

But be sure not to hardcode "/usr/local/Cellar", as some people use another directory (I'm assuming homebrew can be queried for it's prefix).

@phinze
Copy link
Contributor

phinze commented Oct 9, 2012

Good call @autodidakto. Hoping to pick this up this weekend and I'll keep that in mind.

On Tuesday, October 9, 2012 at 3:21 PM, autodidakto wrote:

But be sure not to hardcode "/usr/local/Cellar", as some people use another directory (I'm assuming homebrew can be queried for it's prefix).


Reply to this email directly or view it on GitHub (#18 (comment)).

phinze added a commit that referenced this issue Apr 28, 2013
@phinze
Copy link
Contributor

phinze commented Apr 28, 2013

Months later, this is finally done! 📆

@phinze phinze closed this as completed Apr 28, 2013
@molawson
Copy link
Contributor

molawson commented May 6, 2013

Does this work for you with Alfred 2?

I'm currently running v2.0.3 (187), and it doesn't seem to have a "scope.paths" key in the com.alfredapp.Alfred plist file. I tried adding it with:

defaults write com.alfredapp.Alfred scope.paths -array-add "/opt/homebrew-cask/Caskroom"

But that didn't seem to affect the search scope, even after restarting Alfred.

I feel like I'm missing something obvious here.

@phinze
Copy link
Contributor

phinze commented May 6, 2013

No you're probably right. I developed this feature on Alfred 1.x and just crossed my fingers that the preferences were forwards compatible. ;) I'll finally upgrade and get this fixed up

@phinze phinze reopened this May 6, 2013
@phinze phinze closed this as completed in ce94c6d May 11, 2013
@jfsiii
Copy link
Contributor

jfsiii commented May 11, 2013

brew cask alfred (from USAGE.md) doesn't work for me:

± ~/Sites/homebrew-cask [master @ 19b26b5] ✓ ‣ brew cask alfred
{{ brew-cask }}
  brew-cask provides a friendly homebrew-style CLI workflow for the
  administration Mac applications distributed as binaries
!!
!! no command with name: alfred
!!
available commands:
 - checklinks: checks for bad cask links
 - home: opens the homepage of the cask of the given name
 - list: lists installed casks
 - audit: verifies installability of casks
 - install: installs the cask of the given name
 - info: displays information about the cask of the given name
 - search: searches all known casks
 - uninstall: uninstalls the cask of the given name
 - edit: edits the cask of the given name
 - linkapps: makes a symlink from all cask-installed .app files into ~/Applications
 - unlinkapps: removes symlinks from cask-installed .app files from ~/Applications

I've updated everything I can think of:

± ~/Sites/homebrew-cask [master @ 19b26b5] ✓ ‣ git fetch upstream
± ~/Sites/homebrew-cask [master @ 19b26b5] ✓ ‣ brew update
Already up-to-date.

Any ideas?

@phinze
Copy link
Contributor

phinze commented May 11, 2013

I hadn't cut a release yet with this fix in - so you would have had to be tracking HEAD in order to get the fix.

I just cut v0.10.1 which should include the fix. Let me know if that helps 🚜

@jfsiii
Copy link
Contributor

jfsiii commented May 12, 2013

No dice.

‣ brew update
error: The requested URL returned error: 503 while accessing https://github.com/josegonzalez/homebrew-php/info/refs?service=git-upload-pack
fatal: HTTP request failed
Error: Failed to update tap: josegonzalez/php
Updated Homebrew from de4c580a to 9f1235d6.
==> Updated Formulae
phinze/cask/basic-cask           phinze/cask/carbon-copy-cloner   phinze/cask/gas-mask             phinze/cask/textmate2
phinze/cask/brew-cask            phinze/cask/cura             phinze/cask/launch-bar           phinze/cask/tor-browser-alpha
phinze/cask/calibre          phinze/cask/firefox-aurora       phinze/cask/quicksilver          youtube-dl
‣ brew cask alfred
{{ brew-cask }}
  brew-cask provides a friendly homebrew-style CLI workflow for the
  administration Mac applications distributed as binaries
!!
!! no command with name: alfred
!!
available commands:
 - checklinks: checks for bad cask links
 - home: opens the homepage of the cask of the given name
 - list: lists installed casks
 - audit: verifies installability of casks
 - install: installs the cask of the given name
 - info: displays information about the cask of the given name
 - search: searches all known casks
 - uninstall: uninstalls the cask of the given name
 - edit: edits the cask of the given name
 - linkapps: makes a symlink from all cask-installed .app files into ~/Applications
 - unlinkapps: removes symlinks from cask-installed .app files from ~/Applications

This isn't a blocker for me as I've already added the folder to Alfred. However, it seems like it should be removed from USAGE.md until it's ready to prevent similar questions from others.

@jfsiii
Copy link
Contributor

jfsiii commented May 12, 2013

PEBKAC

All is well after brew upgrade.

brew cask alfred
==> brew cask alfred
manages integration with Alfred; allows applications installed with
homebrew cask to be launched by Alfred by adding the Caskroom to Alfreds
search paths

subcommands:
  status - reports whether Alfred is linked
  link   - adds Caskroom to alfred search paths
  unlink - removes Cakroom from Alfred search paths
brew cask alfred status
==> Alfred is happily linked to homebrew-cask!

@miccal miccal removed bug Issue describing a reproducible bug. enhancement labels Dec 23, 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

5 participants