Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 24 May 2015, 21:26
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
Pmplay - mplayer search / play script
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message

Joined: 25 Feb 2010
Posts: 1400
Location: England. Dell Inspiron 1501. Dpup

PostPosted: Tue 15 Feb 2011, 14:33    Post_subject:  Pmplay - mplayer search / play script
Sub_title: 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:
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.
iron_maiden (if your files have under score instead of blank spaces.
iron maiden (if your files have black spaces instead of under scores)

requires Zenity / Yad it is only 26KB in size:

pmplay Script.

Move Script to
a click on it to decompress.

You can then drag it to desktop or run from terminal with command: pmplay

Back to top
View user's profile Send_private_message 

Joined: 11 Apr 2007
Posts: 890

PostPosted: Thu 17 Feb 2011, 16:12    Post_subject: Media Playing
Sub_title: pmplay

Here's a variation using Gxine and Xdialog to run in puppy without adding Zenity/Yad or Mplayer.

Of course you could use Mplayer by uncommenting the line containing "mplayer" and commenting the line containing "gxine"


loc="`Xdialog --backtitle "Please choose directory..." --title "pmplay-1" --stdout --no-buttons --dselect /root/My-Music 0 0`"
if [ ! $? -eq 0 ];then
string="`Xdialog --stdout --title "pmplay-2" --inputbox "Enter a word or format to search for:" 0 0 *.mp3`"

#find $loc -maxdepth 1 \( -iname "*$string*" \) 2> /dev/null > $list | rxvt -e mplayer -playlist $list
find $loc -maxdepth 1 \( -iname "*$string*" \) 2> /dev/null > $list | rxvt -e gxine -a $(cat /tmp/list.txt)

# make sure those filenames don't have spaces
# execute in dir
# for files in *.mp3; do mv "$files" `echo $files | tr ' ' '_'`; done

Back to top
View user's profile Send_private_message 

Joined: 25 Feb 2010
Posts: 1400
Location: England. Dell Inspiron 1501. Dpup

PostPosted: Fri 18 Feb 2011, 23:19    Post_subject:  

Hey nice one seaside Smile

Here is update for Yad / Zenity Pmplay:

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.

#stu90 - pmplay v0.3


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

PL=$(cat $BOXR | awk '{ print $3 }')

if [ $PL ]; then
echo "playlist found '$PL'"
rxvt -e mplayer -playlist $PL

DIR=$(cat $BOXR | awk '{ print $1 }')
STRING=$(cat $BOXR | awk '{ print $2 }')

case $retval in
echo "Directory to search is '$DIR'"
echo "String to search for is '$STRING'"
find $DIR -maxdepth 1 \( -iname "*$STRING*" \) 2> /dev/null > $PLAYL | rxvt -e mplayer -playlist $PLAYL
echo "Cancel pressed.";;
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot attach files in this forum
You can download files in this forum

Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0488s ][ Queries: 11 (0.0037s) ][ GZIP on ]