display spotify song info in tmux
This commit is contained in:
parent
570ea1689e
commit
c22188f54c
5 changed files with 85 additions and 58 deletions
21
spotify.applescript
Executable file
21
spotify.applescript
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/env osascript
|
||||
# Returns the current playing song in Spotify for OSX
|
||||
|
||||
tell application "Spotify"
|
||||
if it is running then
|
||||
if player state is playing then
|
||||
set track_name to name of current track
|
||||
set artist_name to artist of current track
|
||||
|
||||
if artist_name > 0
|
||||
# If the track has an artist set and is therefore most likely a song rather than an advert
|
||||
"♫ " & artist_name & " - " & track_name
|
||||
else
|
||||
# If the track doesn't have an artist set and is therefore most likely an advert rather than a song
|
||||
"~ " & track_name
|
||||
end if
|
||||
else
|
||||
"⏸︎ Spotify is paused"
|
||||
end if
|
||||
end if
|
||||
end tell
|
||||
Loading…
Add table
Add a link
Reference in a new issue