-
-
Save floere/3708935 to your computer and use it in GitHub Desktop.
A better iTunes
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
#!/usr/bin/env ruby | |
# | |
# Usage: | |
# p [pattern ...] | |
# | |
# Example: | |
# p E*.mp3 pop/A*.mp3 | |
# | |
files = Dir[ARGV.shift || '*.mp3', *ARGV].shuffle | |
puts "Next song: Ctrl-C." | |
puts "Exit: Ctrl-C twice, quickly." | |
puts | |
interrupts = 0 | |
Signal.trap('INT') do | |
exit if interrupts > 0 | |
interrupts += 1 | |
sleep 0.1 | |
interrupts = 0 | |
end | |
files.each do |file| | |
puts file | |
%x{afplay "#{file}"} | |
end |
:)
Add a .cycle
after the shuffle, if you want it to loop forever.
What happened to good old mpg123? :)
It won't support Picky in the future ;)
I've been using BashTunes:
find . -name *.mp3 | xargs afplay
I like it!
But does it really whip the llama's ass? If not, I'll stay with Winamp.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
woooot! ;)