From: Andrew Lorimer Date: Thu, 28 Jun 2018 07:51:39 +0000 (+1000) Subject: improve title shortening regex X-Git-Url: https://git.lorimer.id.au/scripts.git/diff_plain/847f7df3924a8affe5b1e3b34340743122cd1be5?ds=sidebyside improve title shortening regex --- diff --git a/i3blocks-music.pl b/i3blocks-music.pl index 9bee37a..4d6ab27 100755 --- a/i3blocks-music.pl +++ b/i3blocks-music.pl @@ -27,7 +27,7 @@ my $artist = qx(playerctl $player_arg metadata artist); push(@metadata, $artist) if $artist; my $title = qx(playerctl $player_arg metadata title); -$title =~ s/(?:[ ][( ][Ff]eat[. ].*)|(?:[( ][Ff]t[. ].*)//; +$title =~ s/(\s|\s\()[Ff]([et]at[. ].*|t.*//; push(@metadata, $title) if $title; # Print stuff