From 1d04de9c1d219b81bd46326457bba122fb6425f7 Mon Sep 17 00:00:00 2001 From: Andrew Titmuss Date: Fri, 25 Mar 2016 09:54:32 +1100 Subject: [PATCH] added support for Google Play Music Desktop Player also adds an optional dependancy of `gpmdp-bash` --- README.md | 7 +++++-- neofetch | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7c755561..06806670 100644 --- a/README.md +++ b/README.md @@ -84,13 +84,14 @@ your distro's logo or any ascii art of your choice! - Displaying images: `w3m-img` \[2\] \[3\] or `iTerm2` \[4\] - Thumbnail creation: `imagemagick` +- Displaying song information from Google Play Music Desktop Player: `gpmdp` \[5\] ##### Linux / BSD - Wallpaper: `feh`, `nitrogen` or `gsettings` - Current Song: `mpc` or `cmus` - Resolution: `xorg-xdpyinfo` -- Screenshot: `scrot` \[5\] +- Screenshot: `scrot` \[6\] \[1\] See **[#79](https://github.com/dylanaraps/neofetch/issues/79)** about why this is now a required dependency. @@ -103,7 +104,9 @@ terminal emulators that don't support the xterm escape sequences we're using for \[4\] You can enable the `iTerm2` image backend by using the launch flag `--image_backend iterm2` or by
changing the config option `$image_backend` to `iterm2`. -\[5\] You can use the launch flag `--scrot_cmd` or change the config option `$scrot_cmd` to your screenshot
+\[5\] This currently isn't in any repositories, see [`gpmdp-bash`](https://github.com/iandrewt/gpmdp-bash) for install instructions + +\[6\] You can use the launch flag `--scrot_cmd` or change the config option `$scrot_cmd` to your screenshot
program's cmd and neofetch will use it instead of scrot. diff --git a/neofetch b/neofetch index 9cf0f049..981bfa7c 100755 --- a/neofetch +++ b/neofetch @@ -1228,6 +1228,10 @@ getsong () { ;; esac + elif ([ -n "$(ps aux | awk '!(/awk/ || /Helper/) && /Google Play Music Desktop Player/')" ] && [ -n "$(which gpmdp)" ]); then + song="$(gpmdp artist) - $(gpmdp title)" + state="$(gpmdp status)" + 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')"