Music players on Linux – the poor mans random song player.

2012-07-20 1 min read Fedora Learning Linux

If you have more applications running on your system then your system can handle them then you know what I mean when I say that the Music Players take a lot of CPU. Otherwise harmless, but when you are doing too many things, then lot of times you would feel that probably stopping the Music player might help. But then Linux is all about alternatives. So, there is a command line player called mpg123, which does not use so much CPU. But what about playlist 🙂

playlist="/tmp/playlist"
(find . -type f |sort -R) > $playlist
trap exit INT TERM EXIT 1 2 3 15
while read line
do
    mpg123 "$line"
done < $playlist

Just copy this to somewhere as .sh file or just type this in your directory of choice and it will play all the music in that folder in random order without hogging your CPU.

Enhanced by Zemanta
comments powered by Disqus