Skip to content

jimu-gh/Kashi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KASHI · 歌詞 · かし

forthebadge love

build license license

About Kashi

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:

  1. It retrieves data about the current song playing in Spotify, Music, or YouTube via AppleScript.
  2. It calls Genius and checks for a good match in the search hits, accounting for variations such as remixes.
  3. It scrapes the lyrics from the raw HTML of the Genius URL, prettifies, and outputs them onto the Touch Bar.

Regarding YouTube:

  1. YouTube must be playing on the active tab on Chrome or Safari, with window focus.
  2. If both browser and player are open, Kashi will prioritize the player if it is playing.

Installation

Step 1: Install BetterTouchTool

BetterTouchTool can be downloaded here. To install, unzip the download file and move the application file to your Applications folder.

Step 2: Install Python 3 and Packages

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 or pip3 install osascript
  • Requests
    pip install requests or pip3 install requests
  • BeautifulSoup
    pip install beautifulsoup4 or pip3 install beautifulsoup4

Step 3: Import Kashi.json into BetterTouchTool

Open BetterTouchTool Configuration, accessible via the top menu bar.

Open BTT Configuration

Confirm that you are in the Touch Bar Settings.

Touch Bar Settings

Open kashi.json in a text editor. Select all (⌘A) and copy (⌘C).

Select / Copy JSON

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.

Paste JSON Into BTT Configuration Window

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.

Step 4: Set Widget 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! 🎉

History

   11.30.19 Updated for macOS Catalina

   6.23.19 YouTube and browser support added

   12.03.18 Initial release

Resources

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.

Contact

LinkedIn

Homepage

About

Touch Bar widget that displays the lyrics of the current song in Spotify, Music, or YouTube. Written in Python, AppleScript, and JavaScript.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages