-
-
Save jfriedly/5249629 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# as a one liner, just to say I told you so: | |
tail -f $HOME/.config/pianobar/out | sed 's/\x1b\[2K/\n/g' | gawk -v HOME="$HOME" ' BEGIN { i=0; while((getline line<"blacklist") > 0) songs[line]; } { for(song in songs) { if ( $0 == song ) { print "Skipping "song; print "n" > HOME"/.config/pianobar/ctl2"; } } } ' | |
# With whitespace to make it easier to read: | |
tail -f $HOME/.config/pianobar/out |\ | |
sed 's/\x1b\[2K/\n/g' |\ | |
gawk -v HOME="$HOME" ' | |
BEGIN{ | |
i=0 | |
while((getline line<"blacklist") > 0) | |
songs[line]; | |
} | |
{ | |
for(song in songs) { | |
if ( $0 == song ){ | |
print "Skipping "song; | |
print "n" > HOME"/.config/pianobar/ctl2"; | |
} | |
} | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment