New slocate Wrapper

Filemanagers, partitioning tools, etc.
Message
Author
User avatar
smokey01
Posts: 2813
Joined: Sat 30 Dec 2006, 23:15
Location: South Australia :-(
Contact:

#21 Post by smokey01 »

Click on the help button it will give you details, even the compile instructions. Findutils-4.4.2.tar.gz which is the latest although it is quite old.

Cheers

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

#22 Post by musher0 »

smokey01 wrote:Here is a nice little GUI/frontend for findutils called locator.

On Fatdog-700 only the GUI is required as all findutils are included.

For tahr-pup and other 32bit systems you will likely need the full findutils pet, linked below. If you compile your own findutils from source you will need to follow the directions in the help file of locator.

http://www.smokey01.com/software/tahr-6/locator-1.0.pet
http://www.smokey01.com/software/tahr-6 ... -4.4.2.pet
Hi, Smokey.

There is something wrong with your files. They won't install by clicking
on them, and UExtract says there is a gunzip error of sorts in the archive.
Same problem whether the files are downloaded directly from your ftp
site or from here.

Sorry. 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:

#23 Post by smokey01 »

I'm not having that problem here in tahrpup-6.0.2. It installs fine and extracts with Uextract. No problems here with the FD700 package either.

What distro are you using?

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

#24 Post by musher0 »

smokey01 wrote:I'm not having that problem here in tahrpup-6.0.2. It installs fine and extracts with Uextract. No problems here with the FD700 package either.

What distro are you using?
Yesterday evening, it was in puppy 5.4.3, this morning it's in slacko-6.0b...
Same thing in the two distros. The attached may tell more to a trained eye...
Attachments
error-in-locator-pet_2015-03-01.jpg
(42.58 KiB) Downloaded 323 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#25 Post by SFR »

musher0 wrote:
smokey01 wrote:I'm not having that problem here in tahrpup-6.0.2. It installs fine and extracts with Uextract. No problems here with the FD700 package either.

What distro are you using?
Yesterday evening, it was in puppy 5.4.3, this morning it's in slacko-6.0b...
Same thing in the two distros. The attached may tell more to a trained eye...
I think those PETs were gzipped during download, so in order to install/uextract them, you need to ungzip them first:

Code: Select all

mv some.pet some.pet.gz
gunzip some.pet.gz
I encountered this behavior a couple of times, as well as the opposite - ungzipping during download, so the downloaded PET became a plain tar archive.

Anyway, downloading via wget should prevent this.

PS. Both PETs are being downloaded properly in FD64-700 + Chrome-40.

Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

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

#26 Post by musher0 »

Thanks, SFR. Will keep that in mind for Smokey01's site.

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:

#27 Post by smokey01 »

Musher0 I don't think it has anything to do with the site or I'm sure I would have heard about it before now.

What is your method of downloading?

Did SFR suggestion solve your issue?

Cheers

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

#28 Post by musher0 »

smokey01 wrote:Musher0 I don't think it has anything to do with the site or I'm sure I would have heard about it before now.

What is your method of downloading?

Did SFR suggestion solve your issue?

Cheers
Hi, Smokey01.

Yes, thanks for asking, wget did the trick. The files downloaded with
wget are "healthy", although an extra step is needed to untar them.
I did not install them yet, just tested them as unpacked. (I always do
that.) I had done the previous downloads with Opera 12.16.

The find utilities do not work in precise 5.4.3, however. I'll have to try in a
Puppy with glibc 2.17 or higher. (But tomorrow. It's late here.)

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

#29 Post by musher0 »

Updated to version 1g. Please see 1st post. Thanks. musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

gcmartin

#30 Post by gcmartin »

Image

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

#31 Post by smokey01 »

Updated locator-1.0 to 1.1 which includes a progress bar.
http://murga-linux.com/puppy/viewtopic. ... 933#830933

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

#32 Post by musher0 »

gcmartin wrote:Image
Hi, gc.

Thanks again for testing. The slocate wrapper window in the pic above
is too small for these olds eyes to properly read what's written.

Glad to see it runs properly in BK's latest 64-bit creation, though.

Is that an illustration of the "1g" version? Because I see "ticker tape"
background, even if I can't read what's on it. I thought I had removed
the background ticker tape effect in version "1g".

No, that's not version "1g" in your illustration, because the new version
has 4 lines of information to the user at the top, not just 2.

And with version "1g", I now get no ticker tape effect:

Image

and you should be getting none either if using version "1g". 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

#33 Post by musher0 »

Hello!

Another version on the way: it will look like this:

Image

I decided not to use a GUI to pluck and run a line from the slocate search
list, but, as disciple suggested on another thread, "educate" the user
instead. So this version has a little panel that explains how to pluck and
run a file from the slocate listing.

Linux's CLI copy and paste management is actually top notch, it's just a
matter of learning to use it -- and that's really easy once you've thrown
your prejudices against CLI out the window. :)

As you can see in the above capture, plucking and running a song works
just fine using the CLI copy and paste gesture and the rox mime-types.

Top to bottom and left to right: the little how-to, the listing, the launching
console and aqualung playing the song.

I might try to add a "select partition" question if the user remembers less
than more ;) on which drive a file is located, to speed up the search. I'll
check if it can be done.

So please be patient: new pet in construction, I'll likely upload it on Easter
Day? Thanks. (And remove/edit this paragraph.) :)

Almost forgot: thanks to stemsee for new ideas and incentive. :)

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

#34 Post by musher0 »

Hi, folks!

This in answer to a question by Puppus Dogfellow here.

I had answered Puppus D. with a total "nope", but since then I've
discovered that there's a way to mish-mash slocate so the "nope" isn't so
total anymore. There is a way to extract a partial text output from one
slocate db's for a particular term or expression.

I did try to obtain a global extraction of a particular term on all slocate
db's on all partitions, but it doesn't seem to work. Maybe it's because the
db's change during such a global search.

In any case, here it goes; it's still in draft format.

Code: Select all

#!/bin/ash
# $SLOC/Slocate-srch-lim.sh # Link: $MBINS/Lim-Search
#
# Purpose: perform a limited search in already created slocate db's
# and offer the choice of saving the search in *.txt format.
#
# (c) Christian L'Écuyer (alias/aka musher0), Tous droits réservés /
# All Rights reserved, Gatineau (Québec), Canada, 2015-05-21. 
#
# This is still a draft. It still needs a French translation, 
# some ASCII colors, a better layout, etc. Feedback welcome.
# 
####
SLOC="/root/my-applications/SLocate" # Variables
MBINS="/root/my-applications/bin"
DrV="";DatBas="";TeRm="";Entries="";HowMany="";Answer="" 
# Making sure they're empty when we start.
Bye="\tBye for now!\n"

# 1st interactive 
echo -e "\n\tOn which drive is the slocate database stored?"
read DrV
cd /mnt/$DrV &>/dev/null 
[ $? -gt 0 ] && echo -e "\tSorry, there is no such partition. Please try again.\n$Bye" && exit
DatBas="slocate-$DrV.db"
echo -e "\tWhat are you looking for?"
read TeRm

# 1st results
Entries="`slocate -q -n 10000 -d ./$DatBas -r $TeRm | wc -l`"
echo -e "\t$DatBas contains $Entries entries with search expression '$TeRm'.\n"
[ $Entries -eq 0 ] && echo -e "\tPlease try another term or expression.\n$Bye" && exit

# 2nd interactive
echo -e "\tHow many entries of this list do you wish to save or see?
\t(Type '0' for a full listing.)"
read HowMany
[ $HowMany -eq 0 ] && HowMany="10000"
echo -e "\tType 'Y' if you wish to save a listing in *.txt format,
\t'S' for a screen display, any other key to exit."
read Answer

# Final results
case $Answer in
	Y|y)slocate -q -n $HowMany -d ./$DatBas -r $TeRm > $TeRm.txt 
	echo -e "\t\t\tFinished!\n\tYou will find your listing in file $TeRm.txt on partition $DrV.\n"
	;;
	S|s)echo;slocate -q -n $HowMany -d ./$DatBas -r $TeRm | more ;;
	*) echo -e "$Bye" ;; 
esac
echo # Prettier!
### 30 ###
Please note that the slocate db's must exist for this script to work. slocate
must be installed and you must have run the slocate wrapper already.

Example -- Looking for works by jazz pianist Clara Ponty. (See pic.)

Image

Lim-Search stands for "Limited Search".

Simple as pie, no? :) Feedback welcome. BFN.

musher0
Attachments
Slocate-srch-lim.sh.zip
(1.13 KiB) Downloaded 374 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Puppus Dogfellow
Posts: 1667
Joined: Tue 08 Jan 2013, 01:39
Location: nyc

#35 Post by Puppus Dogfellow »

musher0 wrote:Hi, folks!

This in answer to a question by Puppus Dogfellow here.

I had answered Puppus D. with a total "nope", but since then I've
discovered that there's a way to mish-mash slocate so the "nope" isn't so
total anymore. There is a way to extract a partial text output from one
slocate db's for a particular term or expression.

I did try to obtain a global extraction of a particular term on all slocate
db's on all partitions, but it doesn't seem to work. Maybe it's because the
db's change during such a global search.

In any case, here it goes; it's still in draft format.

Code: Select all

#!/bin/ash
# $SLOC/Slocate-srch-lim.sh # Link: $MBINS/Lim-Search
#
# Purpose: perform a limited search in already created slocate db's
# and offer the choice of saving the search in *.txt format.
#
# (c) Christian L'Écuyer (alias/aka musher0), Tous droits réservés /
# All Rights reserved, Gatineau (Québec), Canada, 2015-05-21. 
#
# This is still a draft. It still needs a French translation, 
# some ASCII colors, a better layout, etc. Feedback welcome.
# 
####
SLOC="/root/my-applications/SLocate" # Variables
MBINS="/root/my-applications/bin"
DrV="";DatBas="";TeRm="";Entries="";HowMany="";Answer="" 
# Making sure they're empty when we start.
Bye="\tBye for now!\n"

# 1st interactive 
echo -e "\n\tOn which drive is the slocate database stored?"
read DrV
cd /mnt/$DrV &>/dev/null 
[ $? -gt 0 ] && echo -e "\tSorry, there is no such partition. Please try again.\n$Bye" && exit
DatBas="slocate-$DrV.db"
echo -e "\tWhat are you looking for?"
read TeRm

# 1st results
Entries="`slocate -q -n 10000 -d ./$DatBas -r $TeRm | wc -l`"
echo -e "\t$DatBas contains $Entries entries with search expression '$TeRm'.\n"
[ $Entries -eq 0 ] && echo -e "\tPlease try another term or expression.\n$Bye" && exit

# 2nd interactive
echo -e "\tHow many entries of this list do you wish to save or see?
\t(Type '0' for a full listing.)"
read HowMany
[ $HowMany -eq 0 ] && HowMany="10000"
echo -e "\tType 'Y' if you wish to save a listing in *.txt format,
\t'S' for a screen display, any other key to exit."
read Answer

# Final results
case $Answer in
	Y|y)slocate -q -n $HowMany -d ./$DatBas -r $TeRm > $TeRm.txt 
	echo -e "\t\t\tFinished!\n\tYou will find your listing in file $TeRm.txt on partition $DrV.\n"
	;;
	S|s)echo;slocate -q -n $HowMany -d ./$DatBas -r $TeRm | more ;;
	*) echo -e "$Bye" ;; 
esac
echo # Prettier!
### 30 ###
Please note that the slocate db's must exist for this script to work. slocate
must be installed and you must have run the slocate wrapper already.

Example -- Looking for works by jazz pianist Clara Ponty. (See pic.)

Image

Lim-Search stands for "Limited Search".

Simple as pie, no? :) Feedback welcome. BFN.

musher0
Puppus Dogfellow wrote:
musher0 wrote:Hello, stemsee.
[...]

And of course I still prefer my CLI slocate wrapper over yours. ;)

[...]

musher0

musher, how can you change it so it by default spits out all its results?


thanks.

related to stemsee's offering--is there a possibility that the databases don't work if musher's is installed first--i think that' the situation i'm in...

(apologies for going off topic, since no one else ever seems to have had any difficulty with it and it appears to be a solid part of tahr...)

it looks good to me, musher, and i'd try it out right away if i were not at a machine with a broken "mount" utility. anyway, as i posted here, there's already a built in slocate command to search specific or strings of specific databases:

Code: Select all

slocate --database=[specify path] [search term]
[you can also use --database=path1:path2:path3]

slocate --database=/mnt/sda1/slocate-sda1.db

slocate --database=/mnt/sda2/slocate-sda2.db
slocate --database=/mnt/sda3/slocate-sda3.db
slocate --database=/mnt/sda4/slocate-sda4.db
slocate --database=/mnt/sda5/slocate-sda5.db
it wasn't so much a redirection to text i was asking about (could one add a -o or > after a command like the above or would it require select/middle click? is this the part of the thing that's not working right?) but a way to not have to interact to get the results--default to what your cli called "show all results" or something similar. at some point in the past i asked about searching within specific databases, which is i guess what you mean...

:?

still, the interface and choices shown are excellent. seems like a worthwhile improvement. will definitely test.

thanks.
:D

__________

update:

works for me in precise 5.5, both the select-a-partition and the output to file.

made terminal shortcuts for the main pieces--

sluc--update database
sloc--search, limited
slac--search, all

thanks, musher!

Dry Falls
Posts: 616
Joined: Tue 16 Dec 2014, 23:37
Location: Upper Columbia

#36 Post by Dry Falls »

smokey01 wrote:Updated locator-1.0 to 1.1 which includes a progress bar.
http://murga-linux.com/puppy/viewtopic. ... 933#830933
got the findutils, configured & installed and everything worked effortlessly on Just-Lighthouse frugal install. The only problem is it won't search beyond the root file system (/). I expected it would follow from there through /media, /mnt or /initrd/mnt but no luck. Is this because the partitions are in tmpfs? Is there a way to direct the search string to look outside of ram?

thanks,
df

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

#37 Post by musher0 »

Hello.

Please find attached version 2b. As announced above, it includes a
how-to and a small console to launch your lines from.

I've been testing it for awhile, and it seems to work very well on my
LibrePup-6.0.2.1. The version of Puppy should not matter, though,
because the utilities that this slocate wrapper script relies on exist on
all Puppies that I know.

I was pleasantly surprised by how easy it is to copy & paste from the big
slocate report console to the smallish command console.

With consoles, you don't have to do Ctrl-C in one and Ctrl-V in the other.
You highlight the text you need in one console, you go to other console
and you middle-click. That's it!

This works because rox can launch any file type in its MIME list.

As the attached screen capture shows, it's a breeze to start a file from
any partition with the console copy & paste.

Constructive comments and user reports welcome. Thanks in advance.

Enjoy!

musher0

~~~~~~~~~~~~~~
Additional notes:
-- When you hilite a line in the slocate report console, stop before the dot.
-- By comparison with the previous versions, this version 2b requires
__ wmctrl-1.0.7 as a dependency. (Attached.)
~~~~~~~~~~~~~~
Attachments
Slocate-2b-launcher_Use-of-quotes.jpg
Where to put the quotes in the command line.
(6.62 KiB) Downloaded 266 times
Slocate-2b-lanceur(2).jpg
If slocate is busy updating databases, you will get this message. It takes
about 3 minutes to update 274G worth of files on an old Athlon 2600+. It
will be much faster if you have a multi-core computer and less files.
(7.07 KiB) Downloaded 255 times
Slocate-2b-launcher.jpg
Top: the how-to. Bottom: the small launch console. In the middle, the
slocate find window. The satellite windows close when the main slocate
window closes or when you hit Ctrl-C in it. You cannot affect the how-to
window because it's borderless.
(73.58 KiB) Downloaded 352 times
PuppyTerrier-02b_BIL.pet
The updated wrapper. Detects the system language automatically. At
present, only EN and FR; other localizations are waiting for a translator!
(39.76 KiB) Downloaded 307 times
wmctrl-1.07.pet
For your convenience.
(19.3 KiB) Downloaded 319 times
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

#38 Post by musher0 »

Someone asked by PM if slocate was still being used in this version.

Answer: yes, it is. slocate is still the motor around which this wrapper is
wrapping itself. (Sorry for the bad pun!)

The presence of slocate is perhaps less obvious because in this version
I focused on the ease of use: how-to, launch console, the wide report
window. But the efficient and wonderful slocate utility is still behind it all.

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

#39 Post by musher0 »

Hello again, people!

Here is version 02c already.

This one lets you stay in the search panel as long as you like, doing
as many searches as you like! :) Long live "while...do...done"! :)

In the previous versions, you had to start or restart the wrapper every
time you wanted to do a search.

I won't bother you with screen captures for this one. The only difference,
visually, for the user, is a new sentence at the bottom, when you have
finished a search, explaining which key to type to quit or search again.

Also the need for wmctrl as a dependency is gone in this version: we
don't need it any more. Just the need for (the real) less remains.

Really enjoy! :D

BFN.

musher0
Attachments
PuppyTerrier-02c_BIL.pet
(44.84 KiB) Downloaded 330 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Puppus Dogfellow
Posts: 1667
Joined: Tue 08 Jan 2013, 01:39
Location: nyc

#40 Post by Puppus Dogfellow »

working well in Quirky 7.2 64 bit, musher0.

i needed to use the slocate package below:

slocate-2.7-7.x86_64.rpm

Post Reply