Normal Linux commands to Locate your system files, INSTANTLY
No pet yet.
@Musher0
Your pet and scripts are pretty comprehensive and sophisticated.
I don't know how to call Rox to use its mime types, but that would be ideal.
I need to add the capability to create databases. Or to call your scripts.
For now this can work: enter 'path' for specific db. '/mnt/sda1/var/slocate2.db'
or '/' for example
Also added exit on cancel
@Musher0
Your pet and scripts are pretty comprehensive and sophisticated.
I don't know how to call Rox to use its mime types, but that would be ideal.
I need to add the capability to create databases. Or to call your scripts.
For now this can work: enter 'path' for specific db. '/mnt/sda1/var/slocate2.db'
or '/' for example
Also added exit on cancel
Code: Select all
#!/bin/sh
if [ ! -f /root/.slocateguiflag ]; then
slocate -u
mkdir /usr/share/slgapps
yad --text " Now select the apps you regularly use to open files.\n These will be linked to their own special directory \n to speed up slocategui."
lapps=$(for f in `ls /usr/share/applications`; do echo $f | cut -f1 -d '.' ; done | yad --list --multiple --center --height="400" --column="$filext:" --print-column="1" --separator=" ")
ret=$?
for file in $lapps
do
ls /usr/share/applications | grep -e $file | ln -s $file /usr/share/slgapps/$file
done
touch /root/.slocateguiflag
filext=`yad --title="Find files" --text="What are you looking for?:
e.g. *.mp3" --form --field="Type file name or extension:" `
filext=`echo "$filext" | cut -f1 -d '|'`
if [[ -z "$filext" ]]; then
exit 1
fi
path=`yad --title="Find files in" --text="Which drive to search?:
e.g. / or /mnt/sda2" --form --field="Type path:"
`path=`echo "$path" | cut -f1 -d '|'`
if [[ -z "$path" ]]; then
exit 1
fi
select=$(for f in `slocate --database=$path "$filext"`; do echo $f ; done | yad --list --multiple --center --height="400" --column="$filext:" --print-column="1" --separator=" ")
ret=$?
[[ $ret -eq 1 ]] && exit 0
if [[ $ret -eq 0 ]]; then
app=$(for f in `ls /usr/share/slgapps`; do echo $f | cut -f1 -d '.' ; done | yad --list --center --height="400" --column="$filext:" --print-column="1" --separator=" ")
ret=$?
if [[ -z "$app" ]]; then
exit 1
fi
$app $select &
fi
sleep 3
exec "$0"
else
filext=`yad --title="Find files" --text="What are you looking for?:
e.g. *.mp3" --form --field="Type file name or extension:" `
filext=`echo "$filext" | cut -f1 -d '|'`
if [[ -z "$filext" ]]; then
exit 1
fi
path=`yad --title="Find files in" --text="Which drive to search?:
e.g. / or /mnt/sda2" --form --field="Type path:" `
path=`echo "$path" | cut -f1 -d '|'`
if [[ -z "$path" ]]; then
exit 1
fi
select=$(for f in `slocate --database=$path "$filext"`; do echo $f ; done | yad --list --multiple --center --height="400" --column="$filext:" --print-column="1" --separator=" ")
ret=$?
[[ $ret -eq 1 ]] && exit 0
if [[ $ret -eq 0 ]]; then
app=$(for f in `ls /usr/share/slgapps`; do echo $f | cut -f1 -d '.' ; done | yad --list --center --height="400" --column="$filext:" --print-column="1" --separator=" ")
ret=$?
if [[ -z "$app" ]]; then
exit 1
fi
$app $select &
fi
fi
sleep 3
exec "$0" &
slocate -u
All in due time, gc, all in due time! This needs to mature first!gcmartin wrote:Would there be 2 PETs required or 1 for this work efforts to show up in WOOFCE? Is there a PET that is available that would allow this as an installable/replaceable to existing (current) apps in distro(s)?
I current have EmSee (64bit), JustLightHouse, LxPUP64, and ... to test and report, if need.
I'll take your last sentence as a "rain-check". BFN.
Last edited by musher0 on Thu 02 Apr 2015, 17:01, edited 1 time in total.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
Thanks, stemsee. Back to the workbench with your new thing.
You wrote:
> I don't know how to call Rox to use its mime types, but that would be ideal.
That's as easy as typing : rox "silly song.mp3"
ROX "passes the hand" to the default mp3 player, and the player starts
playing the song.
My understanding is that ROX does the preliminary file type recognition
and then calls the proper executable for that file type.
The quotes are needed because a lot of mp3's have titles with spaces in
them.
TWYL.
You wrote:
> I don't know how to call Rox to use its mime types, but that would be ideal.
That's as easy as typing : rox "silly song.mp3"
ROX "passes the hand" to the default mp3 player, and the player starts
playing the song.
My understanding is that ROX does the preliminary file type recognition
and then calls the proper executable for that file type.
The quotes are needed because a lot of mp3's have titles with spaces in
them.
TWYL.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
I guess my rox Mime types are only partially configured as it doesn't open the file type with any app. Which could mean other users might experience a similar problem, unless the script also configures their rox mime type associations. I usually right click a file and open with. Inefficient habit , but there it is. So a check box to use rox, or app list ... choice!
Hi stemsee.stemsee wrote:I guess my rox Mime types are only partially configured as it doesn't open the file type with any app. Which could mean other users might experience a similar problem, unless the script also configures their rox mime type associations. I usually right click a file and open with. Inefficient habit , but there it is. So a check box to use rox, or app list ... choice!
1st answer: Well, no, it's not an inefficient habit if it works for you. Just
train yourself opening various file types with
rox "blabla.docx" or
rox "blabla.txt",
etc., and see what happens, if only for a test.
2nd answer: That sounds impossible. Here's why:
I did not add any mime-types to my Puppy and I have:
497 lines in file /etc/mime.types
123 objects in dir. /usr/local/apps/ROX-Filer/ROX/MIME
100 objects in dir. /root/Choices/MIME-types
all the OpenOffice mime-types in /usr/share/icons/gnome/NxN
(actually those were added when I installed my OpenOffice 4.1.)
a few in /usr/share/icons/hicolor/NxN/mimetypes
one for cups, one for opera scattered here and there...
and all this in PuppyPrecise 5.4.3 which is 3 years old...
How many mime-types do you have? in what dir's ? In what Puppy ?
If you're in need, I'll e-mail you my copies!
3rd answer: You don't need to configure anything, they should work OOTB.
BFN.
musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
Stemsee?
I finally decided not to go with a GUI but rather this route:
http://murga-linux.com/puppy/viewtopic. ... ost#838307
But many thanks for your useful ideas and incentive.
BFN.
musher0
I finally decided not to go with a GUI but rather this route:
http://murga-linux.com/puppy/viewtopic. ... ost#838307
But many thanks for your useful ideas and incentive.
BFN.
musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
I'm not sure if I posted my final solution so here it is.
You need the findutils from here:
http://www.smokey01.com/software/tahr-6 ... -4.4.2.pet
The GUI here:
http://www.smokey01.com/software/tahr-6 ... 1-tahr.pet
This should work on 32bit puppy's.
You only need the GUI for Fatdog-700 as it already has findutils installed.
You need the findutils from here:
http://www.smokey01.com/software/tahr-6 ... -4.4.2.pet
The GUI here:
http://www.smokey01.com/software/tahr-6 ... 1-tahr.pet
This should work on 32bit puppy's.
You only need the GUI for Fatdog-700 as it already has findutils installed.
- Attachments
-
- locator.jpg
- This is the GUI
- (71.61 KiB) Downloaded 266 times
Hi Smokey.
Your solution does look efficient. Is it available for 32 bit machines?
I think you did post something to that effect earlier. The reason I didn't
react then was because your script is based on locate, not slocate. The
"findutils" do not contain slocate.
I chose to work with slocate instead of locate because it contains within
itself the db creator and the db searcher.
And before you or anyone else criticizes, I try not to use GUI's of this
kind because I personally find them boring. (Sorry for being so frank!)
I realized after the fact that gcmartin probably initiated this thread to push
your own locator, and that I sort of was the dog irrupting in the bowling
alley with my impromptu script.
In any case, what's done is done. No hard feelings or "jealousy", I hope.
None here, anyway.
BFN.
musher0
Your solution does look efficient. Is it available for 32 bit machines?
I think you did post something to that effect earlier. The reason I didn't
react then was because your script is based on locate, not slocate. The
"findutils" do not contain slocate.
I chose to work with slocate instead of locate because it contains within
itself the db creator and the db searcher.
And before you or anyone else criticizes, I try not to use GUI's of this
kind because I personally find them boring. (Sorry for being so frank!)
I realized after the fact that gcmartin probably initiated this thread to push
your own locator, and that I sort of was the dog irrupting in the bowling
alley with my impromptu script.
In any case, what's done is done. No hard feelings or "jealousy", I hope.
None here, anyway.
BFN.
musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
I'm pretty sure it will include usb storage devices but to be honest I can't remember.stemsee wrote:seems to take quite a while to build the database. Will it include usb storage devices?? an i just adapt your gui to work with slocate?
It does take a while to build the database but it is indexing all mounted drives into a single database. This is great because later you can search for files without having to mount the drives. slocate and mlocate maybe a little faster at indexing.
The disk icon is for creating or updating the database as per the tooltip.
It was only designed to find files, not perform any action. I use it for finding all sorts of stuff.stemsee wrote: And how does one use the results? How do they pipe through to a media player?
I would have preferred to use slocate but I couldn't get it to index all files into one database. Musher prefers one database per drive where I prefer a single database so I don't have to mound a drive to search it.
You might have more success than me with slocate. I would be interested in you results.
Cheers