Created
July 6, 2018 19:21
-
-
Save zikes/cc688bdab05cdce426dd7b56a10af8c8 to your computer and use it in GitHub Desktop.
Powerlevel9k + Google Play Music Desktop Player Custom Segment
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
zsh_gpmdp_now_playing(){ | |
local json_file="$HOME/.config/Google Play Music Desktop Player/json_store/playback.json" | |
local is_playing=$(cat "$json_file" | jq '.playing') | |
local artist=$(cat "$json_file" | jq -r '.song.artist') | |
local title=$(cat "$json_file" | jq -r '.song.title') | |
if [[ "$is_playing" == "true" ]]; then | |
echo -n "\ufc58 $artist - $title" | |
fi | |
} | |
POWERLEVEL9K_CUSTOM_NOW_PLAYING='zsh_gpmdp_now_playing' | |
POWERLEVEL9K_CUSTOM_NOW_PLAYING_BACKGROUND='blue' | |
POWERLEVEL9K_CUSTOM_NOW_PLAYING_FOREGROUND='white' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://www.googleplaymusicdesktopplayer.com/
https://github.com/bhilburn/powerlevel9k
https://stedolan.github.io/jq/
Add to prompt elements as
custom_now_playing
, e.g.