From 26e7d546c1828b0d94b25014a487455a7748b8ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Sun, 24 May 2020 10:08:23 +0200 Subject: [PATCH] fix: spotifyd notification format --- configs/spotify.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configs/spotify.nix b/configs/spotify.nix index 860d888..e50f89b 100644 --- a/configs/spotify.nix +++ b/configs/spotify.nix @@ -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" ''); }; });