To show the artist and name of the current playing track on Spotify in your tmux status bar.
Not the first tmux/spotify code. But an attempt to be as simple as possible.
- macOS (as we use applescript)
- Spotify
- Clone this repository
cd
into the root of repository-folder- Run the install script:
The install script will add the code that acutally adds the output of the spotify-script to your status-bar.
./bin/install.sh
- When you start playing a song on spotify, it should now show in tmux!
--filename
: Use parameter to specify the name of the file the code should be added to. Default ~/.tmux.conf."
--with-datetime
: Add datetime info to your statusbar. Default false"
If you want to change the code related that generates the name of the track and artist, please alter bin/spotify_artist_and_track.applescript
More spotify commands can be found here: /Applications/Spotify.app/Contents/Resources/Spotify.sdef
To get syntax highlighting for applescript (in nvim + lua):
- Download the syntax file for applescript here: https://www.vim.org/scripts/script.php?script_id=1736
- Add it to the syntax folder for your nvim runtime. You can find the location by executing the following command in nvim.
:echo $VIMRUNTIME . '/syntax'
- Make sure nvim recognises the filetype by adding the following to a lua script file that is used (for example
init.lua
)
vim.filetype.add({
extension = {
applescript = "applescript",
},
})