Utility lib to create items in JSON format for Alfred
Add this to your application's shard.yml
:
dependencies:
alfred:
github: International/crystal-alfred
At this moment, the only supported format is JSON.
require "alfred"
response = Alfred::Response.new
response << Alfred::Item.new("title", "subtitle", "arg", Alfred::Icon.new("icon","icon.png"))
puts response.to_json
# {"items":[{"title":"title","subtitle":"subtitle","arg":"arg","icon":{"type":"icon","path":"icon.png"}}]}
When using Alfred::Item
, probably the parameter you'll most likely be interested in is arg
.
This is the parameter that gets sent further when you select an item from the list.
- Fork it ( https://github.com/International/crystal-alfred/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
- International George Opritescu - creator, maintainer