Random-Music.sh (Nautilus Script)

Nautilus Scripts

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

0
Score 58.0%
Description:

For those who want a very simple method of randomly playing music, here is a nautilus script to make it extremely easy for everybody.

Requires mplayer and nautilus: sudo apt-get install mplayer nautilus

Directions:
- Put this script inside your ~/.gnome/nautilus-scripts folder
- Once inside your nautilus-scripts folder, it can be run one of two ways:
1. - right click any folder, select this script, and it will automatically randomly play any music file inside it
2. - if nothing is selected when running the script, it will default to this script's preset locations (just add the desired paths to your music in the script beforehand for quick access - add as many paths/menu choices as you would like)

Credit also goes to "nothingspecial" and "VH-BIL" for their part in the creation of this.
Last changelog:

8 years ago

1.0: Initial Release

obscurant

7 years ago

I have a directory full of subdirectories that have radio shows in them. I'd like to right-click on the directory, and have random subdirectories chosen and their contents played in order of file name. Sort of like a random album, but the songs on the album are played sequentially.

Could this be a possible addition to this script, or is it a ludicrous idea and a waste of time?

Report

C

inameiname

7 years ago

Sorry it took so long getting back to you...

Anyway, hmmmmmmm.... thinking about it, I can see your request as being a possibility; definitely not a waste of time. I just do not know off-hand exactly how to do that.

Technically, the part of this script that lets you right click a directory and play what is inside it is a single line:

mplayer -loop 0 -quiet -shuffle -playlist <(find -L $ARCHIVE_FULLPATH -type f | egrep -i '(\.mp3|\.wav|\.flac|\.ogg|\.m4a|\.aac|\.mpa|\.mid|\.aif|\.iff|\.m3u|\.ra)')

I am sure with a small tweak here and there it could be made to work the way you want. I will look into it and will let you know if I can get anywhere, but it might take a posting in Ubuntu Forums or something and some help from people far more skilled at bash scripting than myself to figure it out.

Regardless, it would be a good little idea if it could be done.

Report

ubuntix07

8 years ago

Hi!
I just discover this mini-tool and it's just great and simple!
Thks for sharing!

Report

C

inameiname

8 years ago

You're welcome. That's what I was trying for, nothing special; just something that works.

Report

ubuntix07

8 years ago

But i don't see how it works with videos!

Report

C

inameiname

8 years ago

It doesn't. Although, technically, just adding/removing file extensions at the end of it will make it work with videos. Just add 'avi', 'mp4', 'mkv', or whatever and viola, it'll play videos.

And if you want it to play everything Mplayer can play, just remove all of the extensions at the end, and it'll randomly play anything and everything inside a particular folder.

Report

ilnanny75

8 years ago

I like this :D
Thanks for sharing!

Report

C

inameiname

8 years ago

Sure. Enjoy.

Report

8 years ago

1.0: Initial Release

12345678910
1
product-maker obscurant Dec 04 2011 9 excellent
product-maker Base: 4 x 5.0 Ratings
File (click to download) Version Description Downloads Date Filesize DL OCS-Install MD5SUM
*Needs ocs-url or ocs-store to install things
Pling
0 Affiliates
Details
license
version
1.0
updated Jun 29 2011
added Jun 29 2011
downloads 24h
0
page views 24h 1
System Tags addon