Skip to content

Instantly share code, notes, and snippets.

@todd
Last active April 24, 2019 10:00
Show Gist options
  • Save todd/208287b87bb5a6b378b0 to your computer and use it in GitHub Desktop.
Save todd/208287b87bb5a6b378b0 to your computer and use it in GitHub Desktop.
AppleScript to Get Current Song from Spotify formatted for Tmux Status Bar
tell application "System Events"
set processList to (name of every process)
end tell
if (processList contains "Spotify") is true then
tell application "Spotify"
set artistName to artist of current track
set trackName to name of current track
set symbol to "◻︎"
set col to "red"
if player state is playing then
set symbol to "▹"
set col to "green"
end if
return "#[fg=" & col & "]" & symbol & " #[fg=colour30]" & artistName & " - " & trackName & " #[fg=colour74]| "
end tell
end if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment