Originally Posted by
dddman
Thanks you two
I added some more command launchers to post #1 and still looking for more.
I need a script for "find and locate" so I can add it to my menu.
Keeping scripts in my Home directory I guess is ok. Is there a official place to keep scripts?
I'm not a fan of re-inventing things.
It is customary to put scripts into ~/bin/ and has been for 40+ yrs. Then add ~/bin/ to your PATH. Be certain to only add it if it isn't already there or you could end up with a PATH that is longer than allowed, slow, and causes problems.
I don't understand find and locate script. Just use find or locate or recoll or one of the 50 other file index tools. Or you can create your own index and use grep. I do all of these things.
For example, I have a CLI front end to audio files. It looks through an index of playlists and matches based on a pattern. If more than 1 line is returned, it shows a menu of answers to be selected from. If only 1 item is returned, that gets played either in order or randomly. There are options.
Code:
$ m-search Cartoon
0: /R/Music/Classical/Cartoon_Classics/Classical-Cartoon_Classics.m3u
INFO: Playing: /R/Music/Classical/Cartoon_Classics/Classical-Cartoon_Classics.m3u
The playlist index can be updated using the same tool.
Code:
$ m-search -u
INFO: Done updating $HOME/bin/m3u_files.dat
Code:
$ m-search Spice
0: /R/Music/Pop/s/Spice_Girls/Spice_Girls_all.m3u
INFO: Playing: /R/Music/Pop/s/Spice_Girls/Spice_Girls_all.m3u
I'm not embarrassed at all.
The $HOME/bin/m3u_files.dat file is just the output from a find command.
Code:
# #############################
# want to update m3u lists
if [ "$SEARCH" == "-u" ] ; then
/usr/bin/find $MUSIC -type f -iname \*m3u | tee "$M3U_FILE"
echo "INFO: Done updating "$M3U_FILE" "
exit 0;
fi
Simple little stuff, but extremely powerful when grouped together as a script. Most of the script is just 2-5 lines at a time doing little stuff. I could have used locate instead, but the system with the 5.1 speakers isn't the same as where the files are stored. The locate command doesn't really like crossing onto NFS (or CIFS) storage.
For media stuff, recoll can slurp the metadata from the files, so that information can be searched. Recoll is basically your own google or your files, local. I have it reindex daily. That's a different "media" search.
Code:
$ media-search.sh -u # will update the index.
See my pattern?
I keep a list of already seen movies, TV shows, and ratings, so I never need to see a bad movie twice. That's a huge time-saver. Nobody needs to see The Princess of Nebraska twice.
Bookmarks