Skip to content

Instantly share code, notes, and snippets.

@NTag

NTag/now_deezer.sh

Last active Sep 15, 2020
Embed
What would you like to do?
Display Deezer played track in tmux powerline segment
# Display current played track by Deezer Application
generate_segmentrc() {
read -d '' rccontents << EORC
EORC
echo "${rccontents}"
}
run_segment() {
infos=$(osascript -e '
if application "Deezer" is running then
tell application "Deezer"
local ttitle
local tartist
if (player state = playing) then
set ttitle to (get title of loaded track)
set tartist to (get artist of loaded track)
ttitle & " - " & tartist
end if
end tell
end if')
if [ ! -z "$infos" ]
then
infos=`echo $infos | sed -e 's/(.*)//g' | sed -e 's/ */ /g'`
echo "$infos"
return 0
fi
return 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment