Skip to content

Commit

Permalink
Store prefered search type in user settings
Browse files Browse the repository at this point in the history
  • Loading branch information
streetturtle committed Aug 29, 2021
1 parent 6772e08 commit 02615e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,18 @@
</a>
</p>

A spotlight-like search for spotify, allow searching albums, artists, playlists and tracks and playing the selected item on Spotify client for macOS:
A spotlight-like search for spotify, allows searching albums, artists, playlists and tracks and playing the selected item on Spotify client for macOS:

<img alt="screenrecord" src="https://github.com/fork-my-spoons/spotify-search-and-play.spoon/raw/main/screenshots/screenrecord.gif">

Note that after restarting hammerspoon the default search type will be reset to tracks.

# Installation

This app uses Spotify's search API, so you need to create a developer account in order to use it, go to [Developer Dashboard](https://developer.spotify.com/dashboard/) and register, then create a client id and a secret.

- install [Hammerspoon](http://www.hammerspoon.org/) - a powerfull automation tool for OS X
- Manually:

Download the [latest release](https://github.com/Hammerspoon/hammerspoon/releases/tag/0.9.87), and drag Hammerspoon.app from your Downloads folder to Applications.
Download the [latest release](hhttps://github.com/Hammerspoon/hammerspoon/releases/latest), and drag Hammerspoon.app from your Downloads folder to Applications.
- Homebrew:

```brew install hammerspoon --cask```
Expand Down
3 changes: 2 additions & 1 deletion init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,10 @@ function obj:init()
{ id = "track", selectable = true, image = hs.image.imageFromPath(obj.iconPath .. '/musical-note.png'):template(true)},
}):canCustomize(true)
:autosaves(true)
:selectedItem("track")
:selectedItem(hs.settings.get("spotify-search-and-play_selectedItem") or "track")
:sizeMode("small")
:setCallback(function(toolbar, chooser, identifier)
hs.settings.set('spotify-search-and-play_selectedItem', identifier)
self.item_type_to_search = identifier
self:queryChangedCallback()
end)
Expand Down

0 comments on commit 02615e1

Please sign in to comment.