I want to be able to use kaffeine or another media player to randomly play an arbitrary number of the newest files in a particular directory. Preferably with as little typing as possible, and I am not opposed to using a script or an alias. I figure there's some way I can use head and ls -1 or some other parameter to create a list that I can pass to kaffeine (mplayer, dragon player, etc) as a parameter. I'm using bash on Ubuntu Jaunty Jackalope if it makes any difference.
Tell me more
×
Super User is a question and answer site for
computer enthusiasts and power users. It's 100% free, no registration required.
|
Here is a function to create the file list:
It defaults to 15 files, but accepts a parameter for a different number. The last sort puts the list in random order. For mplayer, you should be able to do:
or
Note that mplayer has a |
||||
|
|