1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00

fix: spotifyd notification format

This commit is contained in:
Kierán Meinhardt
2020-05-24 10:08:23 +02:00
parent fd36d5279c
commit 26e7d546c1

View File

@@ -26,10 +26,10 @@ in
on_song_change_hook = toString (pkgs.writers.writeDash "songinfo" ''
PATH=$PATH:${lib.makeBinPath [pkgs.playerctl pkgs.gawk pkgs.libnotify]}
metadata=$(playerctl metadata --player spotifyd)
title=$(echo "$metadata" | awk '/xesam:title\s/ { print substr($0, index($0, $3)) }')
artist=$(echo "$metadata" | awk '/xesam:artist\s/ { print substr($0, index($0, $3)) }' | paste --serial --delimiters "/")
album=$(echo "$metadata" | awk '/xesam:album\s/ { print substr($0, index($0, $3)) }')
notify-send --app-name=" Spotify" "$title" "$album $artist"
title=$(echo "$metadata" | awk '/^xesam:title\s/ { print substr($0, index($0, $3)) }')
artist=$(echo "$metadata" | awk '/^xesam:artist\s/ { print substr($0, index($0, $3)) }' | paste --serial --delimiters "/")
album=$(echo "$metadata" | awk '/^xesam:album\s/ { print substr($0, index($0, $3)) }')
notify-send --app-name=" Spotify" "$title" "$artist $album"
'');
};
});