From c34acdcebab3532929655f9c08ebb2e706bb8635 Mon Sep 17 00:00:00 2001 From: Andrew Lorimer Date: Thu, 6 Jun 2019 15:31:33 +1000 Subject: [PATCH 1/1] fix parenthesis detection in i3blocks-music --- i3blocks-music.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/i3blocks-music.pl b/i3blocks-music.pl index 62e3a16..2cebc38 100755 --- a/i3blocks-music.pl +++ b/i3blocks-music.pl @@ -28,12 +28,12 @@ push(@metadata, $artist) if $artist; my $title = qx(playerctl $player_arg metadata title); $title =~ s/(\s|\s\()[Ff]([et]at[. ].*|t.*)//; -$title =~ s/(\s\(.+\) *|\s-\s.+)//; -$title =~ s/&/&/; +$title =~ s/((\s(\(|\[).+(\)|\]).+)|(\s-\s.+))+//; +$title =~ s/&/&/; # fix ampersand rendering for i3bar push(@metadata, $title) if $title; for (@metadata){ - s/\n//; + s/\n//; # remove newlines } # Print stuff -- 2.43.2