me

notes from mnlwldr

Thoughts about programming and other things I want to share

@mnlwldr on Twitter @mnlwldr on GitHub @mnlwldr on Mastodon mnlwldr@gmail.com defer.cc

Moved my somafm ‘player’ to bashrc

_somafm() { 
   mpv $1 2> /dev/null | awk '/title/ { s = ""; for (i = 2; i <= NF; i++) s = s $i " "; cmd="(date +'%H:%M:%S')"; cmd | getline d; print d,"|",s; close(cmd) }' 
}
alias groovesalad='_somafm "http://ice.somafm.com/groovesalad-128-aac"'
alias defcon='_somafm "http://ice.somafm.com/defcon-128-aac"'
alias deepspaceone='_somafm "http://ice.somafm.com/deepspaceone-128-aac"'

Don’t forget to support

Tags: #bash #somafm

Have you written a response to this? Let me know the URL