Last active
April 24, 2019 10:00
-
-
Save todd/208287b87bb5a6b378b0 to your computer and use it in GitHub Desktop.
AppleScript to Get Current Song from Spotify formatted for Tmux Status Bar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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