Skip to content

kio_locate -- my little KDE gem of the week

Monday, 1 November 2004  |  pipitas


My favourite little KDE gem of the week is kio_locate. Its maintainer, Armin has now added support for regular expressions and piping results through grep. This increases usefulness by at least a factor of 10...



Ahhh -- you didn't know kio_locate at all up to now? Don't fear: until last Saturday not even distinguished KDE core hackers such as danimo did. After I showed it to him, he was sold. (In return, he promised to burn a CD with legal sound files for me to test the new amaroK with... danimo, I'm waiting.).



kio_locate is one very small, but oh!, so useful little addition to KDE. It utilizes the powerful, yet still underrated KIO Slave architecture of KDE. KIO slaves add "protocols" to your desktop and let each application use these. A good first introduction you can gain from a recent article published on O'Reilly's OSDir.com website.



So what about kio_locate? We all know the good old locate command. Some of us, who haven't organized their directory hierarchy too well, type "locate sylvia.jpg" (or whatever we happen to search for) every day into a konsole window. The result we got, we then highlighted and pasted into the address field of gwenview (or whatever cool image viewer program we happen to prefer). Quite an effort.



With kio_locate you can do (nearly) the same now in a Konqueror address field. Type in "locate:sylvi.jpg" and you'll get a list of matching pathnames in a konqueror window. Now you can do whatever you wanted to: click on one of the results to open it in  your imaging application, drag it to a new location, copy it to another place, cram all matching pics into a *.tar.gz-archive... No detour needed via konsole -- do all at one place.



As with all KIO Slaves, kio_locate isn't just for the Konqui address field. It can be used in each and every KDE application that understands URLs. Most important of all, you can use it directly in all "File Open" dialogs. Again, this safes lots of detours, clicks and typing effort.    



kio_locate isn't part of KDE currently. Hopefully it will be in 3.4. But to download it, untar/-zip and type ./configure; make; sudo make install didnt take more than 5 minutes. Achim even provides the required documentation. After doing ALT+F2, typing khelpcenter, I easily found the little manual in the "kioslaves" section of the documentation. It is also online. And if you are keen for screenshots, look here.

  • Can you make the search case-insensitive?
    Yes, you can. Use "ilocate:sYlVi.JPG" .
  • Can you get the matching result of, say locate kdeprint | grep -v kde-unstable | grep lib   ?
    Yes, you can. Use "locate:kdeprint !kde-unstable lib" .
This last item took only a little question on KDE-kapps.org to ask. And 3 days later Achim had implemented it. Cheers, Achim!