Normal Linux commands to Locate your system files, INSTANTLY

Using applications, configuring, problems
Message
Author
musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#141 Post by musher0 »

... or copy and paste with the good old middle button...

Image
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

gcmartin

#142 Post by gcmartin »

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.

stemsee

#143 Post by stemsee »

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

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

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#144 Post by musher0 »

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.
All in due time, gc, all in due time! :) This needs to mature first! :)
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)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#145 Post by musher0 »

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.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

stemsee

#146 Post by stemsee »

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!

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#147 Post by musher0 »

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!
Hi stemsee.

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)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#148 Post by musher0 »

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
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

stemsee

#149 Post by stemsee »

withdrawn
Last edited by stemsee on Tue 21 Apr 2015, 21:05, edited 2 times in total.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#150 Post by musher0 »

Did you include a "Thanks to musher0" comment somewhere? ;)
I don't see any!!! :)
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

stemsee

#151 Post by stemsee »

updated!

stemsee

#152 Post by stemsee »

withdrawn
Last edited by stemsee on Tue 21 Apr 2015, 21:05, edited 1 time in total.

stemsee

#153 Post by stemsee »

withdrawn
Last edited by stemsee on Tue 21 Apr 2015, 21:04, edited 1 time in total.

User avatar
smokey01
Posts: 2813
Joined: Sat 30 Dec 2006, 23:15
Location: South Australia :-(
Contact:

#154 Post by smokey01 »

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.
Attachments
locator.jpg
This is the GUI
(71.61 KiB) Downloaded 266 times

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#155 Post by musher0 »

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
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
smokey01
Posts: 2813
Joined: Sat 30 Dec 2006, 23:15
Location: South Australia :-(
Contact:

#156 Post by smokey01 »

It was for stemsee' s benefit as he has posted a GUI.

Cheers

stemsee

#157 Post by stemsee »

Looks good smokey01. All in one page. is the save icon to save the results. And how does one use the results? How do they pipe through to a media player?

cheers.

I will try it to see for myself , of course.

stemsee

#158 Post by stemsee »

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?

User avatar
smokey01
Posts: 2813
Joined: Sat 30 Dec 2006, 23:15
Location: South Australia :-(
Contact:

#159 Post by smokey01 »

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?
I'm pretty sure it will include usb storage devices but to be honest I can't remember.

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.
stemsee wrote: And how does one use the results? How do they pipe through to a media player?
It was only designed to find files, not perform any action. I use it for finding all sorts of stuff.

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

stemsee

#160 Post by stemsee »

First attempt. I renamed /usr/bin/locate locates, then linked /usr/bin/slocate > locate and seems to be working fine! So this one gui can at least replace the three popups I used in my yad system, but .... let's see what I can do with it.

Post Reply