Kashi is a custom BetterTouchTool widget that displays the current song lyrics on the Macbook Pro's Touch Bar.
Kashi works with Spotify, Music, and Youtube (Chrome or Safari).
Kashi has three main functions:
- It retrieves data about the current song playing in Spotify, Music, or YouTube via AppleScript.
- It calls Genius and checks for a good match in the search hits, accounting for variations such as remixes.
- It scrapes the lyrics from the raw HTML of the Genius URL, prettifies, and outputs them onto the Touch Bar.
Regarding YouTube:
- YouTube must be playing on the active tab on Chrome or Safari, with window focus.
- If both browser and player are open, Kashi will prioritize the player if it is playing.
BetterTouchTool can be downloaded here. To install, unzip the download file and move the application file to your Applications folder.
Install Python 3 and the Python packages below.
For help with package installation, please refer to the Python Packaging User Guide.
- OSAscript
pip install osascript
orpip3 install osascript
- Requests
pip install requests
orpip3 install requests
- BeautifulSoup
pip install beautifulsoup4
orpip3 install beautifulsoup4
Open BetterTouchTool Configuration, accessible via the top menu bar.
Confirm that you are in the Touch Bar Settings.
Open kashi.json
in a text editor. Select all (⌘A) and copy (⌘C).
Click somewhere on the trigger list (left column, striped), and Paste (⌘V) directly into the BetterTouchTool Configuration window. The new widget will appear in your list.
Depending on how your Python is installed, the widget may already be working. If not, do Step 4 below to configure the widget's parameters.
The Launch Path parameter must direct to your Python 3 install. PATH will also work.
Default - "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7"
The second parameter must refer to Python's "site-packages" folder containing Python modules.
Default - "/Library/Frameworks/Python.Framework/Versions/3.7/lib/Python3.7/site-packages"
Lyrics for the currently playing song should now appear on the Touch Bar. Enjoy! 🎉
11.30.19 Updated for macOS Catalina
6.23.19 YouTube and browser support added
12.03.18 Initial release
For detailed information about Touch Bar customization, please refer to the official BTT Documentation.
More awesome Touch Bar presets can be found on the BTT Community.
ChengHaoMou's Touchbar-Lyric is a similarly inspired widget accessing NetEase's API for real-time lyrics display.