From: Andrew Lorimer Date: Tue, 4 Jun 2019 07:31:28 +0000 (+1000) Subject: i3blocks-music.pl: remove line breaks and punctation-delimited postambles X-Git-Url: https://git.lorimer.id.au/scripts.git/diff_plain/599b42240513bc72fe774ac75b720853c056ef41?ds=sidebyside i3blocks-music.pl: remove line breaks and punctation-delimited postambles --- diff --git a/i3blocks-music.pl b/i3blocks-music.pl index cd32d15..62e3a16 100755 --- a/i3blocks-music.pl +++ b/i3blocks-music.pl @@ -28,9 +28,14 @@ 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/&/&/; push(@metadata, $title) if $title; +for (@metadata){ + s/\n//; +} + # Print stuff print(join(" - ", @metadata)) if @metadata; print("");