Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I like having google desktop search on my work computer, but could use it even more on my linux computer. I know "slocate -u" will create an index of my files and slocate -i filename will conduct a search for a file. slocate is also lightning fast. Is there a linux version of google desktop search that uses slocate?
Or, is there a way to send slocate output to html format?
If not, could someone put one together? Not much of a task for a hot-shot programmer, but it would be of great use.
#!/bin/bash
if [ -z $1 ]; then
echo "Usage: $(basename $0) <searchterm> [outputfile.html]"
exit 1
fi
if [ ! -z $2 ]; then
wrap(){
$1 >> $2
}
else
wrap(){
$1
}
fi
wrap "echo <html><head><title>locate results</title></head><body><pre>" $2
wrap "locate $1" $2
wrap "echo </pre></body></html>" $2
Simple and dirty as turkey beef.. Works, but thats all I can promise for it. Save it in a file, make it executable and run. if you dont give an output file, youll get in out as standard output. It totally beats me why you'd want it out as html, but thats not my place to ask.. (;
Well, its easy adding a few more echoes to the code to construct a fancier page, or just implement the whole damn thing as php.. That would actually be pretty cool.. A localhost webpage to run locate, find and so on on your own computer..
I might just implement this and report back when its done.. (;
edit:
ive never seen this google desktop search, so a few details wouldnt hurt.. (:
There seem to be several implementations already: Beagle and Kat
But basing on my own tests of them, they seriously suck. Beagle has weird kernel dependncies, and crashes alot (official suse 9.3 pro packages.. /: ) And Kat was a pain to install on anything else than Mandriva, and still it didnt deliver what it promised.
So, some definate improvement is still needed before id recomend those to anyone.
its there in the code actually incase you missed it.. (: My logic behind it is pretty simple, it figures wether we were given a file parameter and if not, prints directly to stdout, otherwise to the file. Kinda useless now that I think of it, but aaaanyways (:
I Think there is a valid need for a google desktop search clone in Linux. Here is your chance to make your mark in the Linux World Artanicus (if you haven't already). It would be a great contribution. Let me know if you are interested. I run a server if you need a development space w/ CVS & FTP. I would be glad to sponsor!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.