arminstraub.com

kio-locate

Note: This page is hopelessly outdated and dates back several years to when I was maintaining kio-locate. A new version of this tool, that has been ported to KDE4, can be found at http://websvn.kde.org/trunk/playground/ioslaves/kio-locate/.

kio-locate: A KDE I/O Slave

Probably you know the locate command for doing quick file searches. kio-locate enables you, to start such a search from konqueror.

  • To search using locate you don't have to switch to a prompt.
  • The search results are shown to you, as if you were in a directory. Any found file is just one click away.
  • You could e.g. move all found files using Drag & Drop.
  • And all that's possible from practically any KDE program, that can open files.

Perhaps you should just take a look at the screenshots.

Unfortunately, I currently don't have the time to maintain kio-locate.

Many thanks to Tobi Vollebregt who has been improving kio-locate as a participant of Googles "Summer of Code". Thank you very much!

Changelog

 kio-locate 0.4.5 2006/02/05Armin Straub
*Search hits with non-ascii characters in the file name always showed up with invalid size/owner/group information (fixed by Johan Billing).
*kio-locate should now compile with gcc-4.1_beta (fixed by Jan Jitse Venselaar).
*Updated to bksys 1.5.1.
 
 kio-locate 0.4.4 2005/10/19Armin Straub
+Warn if locate (or whatever is selected) is not installed (suggested by Axel K. Braun).
*Use slocate and rlocate as default when available (suggested by Nicolas Degand).
*Closed a bug preventing the display of items having the same prefix (reported by Takis).
 
More ...

Download kio-locate

You can download kio-locate either as a debian package or as full sourcecode.

LinkSizeDescriptionHits
151.64 KB kio-locate 0.4.5 (source code) 2432
101.49 KB kio-locate 0.4.5 (Debian/sid, thanks to Karsten Schulz) 2078
151.98 KB kio-locate 0.4.4 (source code) 927
More Downloads... 

Some TODOs

 Short Term
 
 Mid Term
+Add kio-locate to kde-extragear.
+Translations needed. Contact Håvard Dahle for Norwegian translation.
+Support searches on remote servers via ssh. A possible search could then look like "locate://username@server:port pattern". (Suggested by Ferdinand Gassauer)
 
 Ideas
+Some kind of first start screen?
+Check out beagle-query which was said to behave similar to command line locate. (Benjamin Kudria)
+Use other backends like kat?
 

How to use this?

You can use kio-locate mostly as you use locate. Instead of typing

$ locate pattern
at a prompt, you start the search with kio-locate directly in konqueror. You just enter locate:pattern as the address.

New: Configure kio-locate

Starting with version 0.4.0 you can configure kio-locate by entering locater:config in konqueror's adress bar (note the r).

A normal search using locate:pattern is case insensitive. But if your search contains upper case characters, the search switches to case sensitivity. You can change this behaviour using locater:config.

How to write Patterns

  • Furthermore you can't use a backslash as the last character of your query. O.k. you can, but KDE will ignore it. In such a case you can quote your pattern: Write locate:"servicemenus/" rather than locate:servicemenus/.
  • A search as e.g. locate:~/*.doc works as you might expect. This means that ~/ and ~user/ are expanded correctly at the beginning of the pattern.
  • In older versions of KDE you can't use a star (*) for a pattern in konqueror. Therefor every plus (+) in a search is used just as a star (*) is. Instead of locate:*.html you may also type locate:+.html.
  • Should you need to use a plus in your search you have to escape it with a backslash. Instead of locate:g++ you have to use locate:g\+\+.

New: Using Filters

Often you will get lots of results using locate. To filter your search you could use

$ locate kdeprint | grep -v apidocs | grep lib
on the command line to find those files matching kdeprint that don't contain api-docs but lib.

Starting with version 0.3.0 kio-locate has builtin support for such filtering. You can e.g. use locate:kdeprint !api-docs lib to get the same results as above.

You can use arbitrarily many filtering expressions. Those that should not match are prepended by !. To use regular expressions you can use rlocate instead of locate as the protocol.

You can add arbitrary filters to a white- resp. blacklist (using locater:config). This way you can restrict your search to certain folders generally or exclude single directories. If you e.g. replace . by /home/. in your whitelist you will only find files under /home afterwards.

Using this as the default search engine

Since version 0.3.1 you are enabled to select kio-locate as konquerors default search engine (under Web Shortcuts). Whenever you enter an url then, that konqueror can't deal with, a search using locate will be started.

So you can just enter a filename and konqueror will search for it. This saves you the characters needed for the usuallay prepended locate:.

Last change: 2006/10/09
31761 reads