Posted: Tue 15 Feb 2011, 14:33 Post subject:
Pmplay - mplayer search / play script Subject description: Zenity / Yad script + Xdialog version by seaside
Not sure where to post this but maybe some one might find some use for it.
What is it?
A basic 2 box GUI for Mplayer made with Zenity / Yad.
What does it do?
In the first GUI box you type path or drag and drop a directory that contains some media file/s you want to play with terminal Mplayer.
click ok and it will open the second GUI box
In the second box you enter either a word of file format to search for in that directory- example: Maiden or .mp3 or .avi
It then creates a playlist in /tmp out of the results that have Maiden in the file name or files that have an .mp3 extension and then terminal Mplayer plays that playlist.
To play a single meida file, example:
/root/music_video.avi
Type path or drag media file into GUI box one and leave GUI box two blank and click ok.
Word search.
If you know how your media files are formated blank space or under score - you can search for more than a one word string as long as it matches part of the actual file name.
example:
iron_maiden (if your files have under score instead of blank spaces.
iron maiden (if your files have black spaces instead of under scores)
Now all in one window + added a third Box for playing pre made Mplayer playlists - leave Box1 and Box2 as the are and enter the path or drag the playlist to box three.
Code:
#!/bin/bash
#stu90 - pmplay v0.3
BOXR="/tmp/boxr"
PLAYL="/tmp/playlist"
yad --title "Pmplay" --form --separator=' ' \
--text " In Box1 enter or drag a directory to seach. \n
In Box2 enter a file format or word to seach. \n
Or In Box3 enter a pre made playlist to play." \
--field=Box1 '/root' \
--field=Box2 '.mp3' \
--field=Playlist > $BOXR
if [ $? = 1 ];
then exit
fi
PL=$(cat $BOXR | awk '{ print $3 }')
if [ $PL ]; then
echo "playlist found '$PL'"
rxvt -e mplayer -playlist $PL
else
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum