mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-10-04 01:00:17 +00:00
Merge pull request #138 from iandrewt/osx_songs
OSX: Added Itunes/Spotify support to getsong
This commit is contained in:
8
neofetch
8
neofetch
@@ -1139,6 +1139,14 @@ getsong () {
|
||||
song=${song//'['*}
|
||||
;;
|
||||
esac
|
||||
elif [ -n "$(ps aux | awk '!(/awk/ || /Helper/) && /iTunes/')" ]; then
|
||||
song="$(osascript -e 'tell application "iTunes" to artist of current track as string & " - " name of current track as string')"
|
||||
state="$(osascript -e 'tell application "iTunes" to player state as string')"
|
||||
|
||||
elif [ -n "$(ps aux | awk '!(/awk/) && /spotify/')" ]; then
|
||||
song="$(osascript -e 'tell application "Spotify" to artist of current track as string & " - " & name of current track as string')"
|
||||
state="$(osascript -e 'tell application "Spotify" to player state as string')"
|
||||
|
||||
else
|
||||
song="Unknown"
|
||||
fi
|
||||
|
Reference in New Issue
Block a user