Right Click - "Add to Playlist in vlc"

93 views
Skip to first unread message

narendra sisodiya

unread,
Mar 21, 2010, 4:18:29 AM3/21/10
to IITDLUG, glug-meerut
If you want to make a quick dirty solution for - right Click add to playlist in vlc then follow this

#cd
# cd .gnome2/nautilus-scripts
# touch "Add to Playlist"
# chmod +x "Add to Playlist"
# gedit "Add to Playlist"

---------------- Paste this code -------------

#!/bin/bash

## Ny Narendra Sisodiya, for SchoolOS
## narendra...@gmail.com
## If you modify it, Please let me know.


IFS=$'\n'
for FILENAME in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
do
   vlc --started-from-file --playlist-enqueue "$FILENAME"
done

exit 0


------------------  SAVE and CLOSE.  ---------------


Now enjoy right click adding to vlc.

#How you can improve it.
current script do not have file extension or mimetype adding, it will add all type of files ,there should be file extension checking so that only media files allowed to add to playlist.





--
┌─────────────────────────┐
│    Narendra Sisodiya ( नरेन्द्र सिसोदिया )
│    Society for Knowledge Commons
│    Web : http://narendra.techfandu.org
└─────────────────────────┘
right click.png

narendra sisodiya

unread,
Mar 21, 2010, 4:31:41 AM3/21/10
to IITDLUG, glug-meerut
Hi, I just wanna know feedback,
Also, tell me what more script and GUI facilities you want. This will help in improving SchoolOS design.
Thanks.

narendra sisodiya

unread,
Mar 21, 2010, 4:48:51 AM3/21/10
to IITDLUG
Task
A -- You can help in making a script which can convert any media file to Ogg file
http://code.google.com/p/freedombucket/source/browse/trunk/ConvertAlltoOgg.sh
http://varshamyspace.blogspot.com/2009/04/convrsion-from-one-audio-format-to.html
http://varshamyspace.blogspot.com/2010/03/converting-between-different-audio.html

B- --
you can help in giving right click option of printing pdf/odf files using nautilus scripts.


C-
Search on Internet for other useful nautilus script and shareit here So i can include them


Thanks

irfan naseef

unread,
Mar 21, 2010, 5:20:06 AM3/21/10
to iit...@googlegroups.com



Thanks

--
LUG@IITD - http://tinyurl.com/ycueutm
 
To unsubscribe from this group, send email to iitdlug+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.



Thanx Narendra , Its really a nice script. But as you mentioned , it s not checking the file type.


--
   !rF@n

narendra sisodiya

unread,
Mar 21, 2010, 5:23:32 AM3/21/10
to iit...@googlegroups.com


On Sun, Mar 21, 2010 at 2:50 PM, irfan naseef <irfann...@gmail.com> wrote:


Thanx Narendra , Its really a nice script. But as you mentioned , it s not checking the file type.

Two reasons,
1 . I do not have enough time to make a fine tuned application.
 2 . Other can contribute

irfan naseef

unread,
Apr 29, 2010, 2:36:16 AM4/29/10
to iit...@googlegroups.com
> --
> LUG@IITD - http://tinyurl.com/ycueutm
>
> To unsubscribe from this group, send email to
> iitdlug+unsubscribegooglegroups.com or reply to this email with the words
> "REMOVE ME" as the subject.
>

A more updated version of the code.

#!/bin/bash

## Ny Narendra Sisodiya, for SchoolOS
## narendra...@gmail.com
## If you modify it, Please let me know.

checkFileType()
{
file $1 | grep -i "audio" || file $1 | grep -i "video" || file $1 |
grep -i "ogv" || file $1 | grep -i "mpeg"
RES=$?
if [ $RES -eq 0 ]
then
return 0
else
zenity --error --title "VLC says: " --text "Error: $FILENAME is
not an audio/video file"
return 1


fi
}

IFS=$'\n'
for FILENAME in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
do
checkFileType $FILENAME

if [ $? -eq 0 ]
then
vlc --started-from-file --one-instance-when-started-from-file
--playlist-enqueue "$FILENAME"

fi
done

exit 0



--
catch me at :
twitter.com/irfan_np
blogs at: irfantechinfo.blogspot.com
Add to VLC Playlist

narendra sisodiya

unread,
Apr 29, 2010, 4:22:52 AM4/29/10
to iit...@googlegroups.com

Please use oscontrib or schoolos for any such development and contribution discussion. LUG@IITD and other mailing list are basically for linux users .


On Thu, Apr 29, 2010 at 12:06 PM, irfan naseef <irfann...@gmail.com> wrote:


checkFileType()
{
 file $1 | grep -i "audio" || file $1 | grep -i "video" || file $1 |
grep -i "ogv" || file $1 | grep -i "mpeg"
 RES=$?
 if [ $RES -eq 0 ]
 then
     return 0
 else
     zenity --error --title "VLC says: " --text "Error: $FILENAME is
not an audio/video file"
     return 1


  fi
}


Are you sure, this will cover all filetypes supported by VLC ?

irfan naseef

unread,
Apr 29, 2010, 5:34:13 AM4/29/10
to iit...@googlegroups.com
It covers most of them. I dont know if they cover all or not.
Reply all
Reply to author
Forward
0 new messages