Update, January 22,2018:
I have stumbled upon mlocate-web on GitHub, which fits OP's requirements quite well, although lacks ability to open files. Can be ran manually or as daemon. According to the README.md, the package was developed on Ubuntu 16.04, so it's quite recent as of right now.
Mini-update, Feb 2
Added double quotes to gnome-open "$TOPEN"
, so that gnome-open gets full pathname of files that have space.
Update # 2,Jan 30 :
As requested in the comments , I've refined the script, and added the option to open files. Everything is implemented with zenity, locate, and gnome-open. Praise the Unix philosophy of piping commands into others !
I've annotated the script , so it should be clear where, what, and how.
In the screenshots I'm opening the Hello World program for java.
The script exits at any point if user clicks Cancel/Quit buttons.
Side note: The OP requested that the app should be cross-platform. As far as I know, zenity,gnome-open, and locate are not dependent on presence of GNOME shell. Besides, users will be connecting to his Ubuntu server, and all those apps work on Ubuntu regardless of GNOME shell's presence. In other words, they're going to be executing the script on his system, not theirs, to locate the files.
The refined script:
#!/bin/bash
# Author: Serg
# Description: GUI using zenity for locate utility
# Date: January 30, 2015
# This flag will make popup appear if nothing was found
FOUND=0
# Ask user for input, and store it in USRFILE variable
USRFILE=`zenity --entry --title="SEARCH" --entry-text="Text here" --text="Enter a filename or part of it"`
# if use clicked OK, proceed to this big if statement
if [ $(echo $?) = 0 ]
then
TOPEN=$( ( locate $USRFILE ) | ( zenity --height 450 --width=450\
--list --column "Please wait, I'll display paths to files, if I find any"\
--title "SEARCH RESULTS" --text "Select a file you want to open"\
--height=450 --width=450 --ok-label="Open a file " --cancel-label="Quit" ) )
# FIXME: if user clicks open a file without selecting one, program will crash
# FIXME: selecting a file and hitting enter, brings up "Nothing found" dialog
# If user clicked "Open a file" , gnome-open
# will open it with whatever default
# program is listed for that file-type
if [ $(echo $?) = 0 ]
then
gnome-open "$TOPEN"
fi
# Set flag to true, do not display "Nothing found"
if [ $(echo $?) = 0 ]
then FOUND=1
fi
# If we didn't find anything, display a message
if [ $FOUND != 1 ]
then zenity --info --text="Nothing found"
fi
fi
Screenshots of the refinements
Get user input
Display search results if any, might take a moment to load
Open the selected file
For a suggestion on how to make this script open with a short-cut (double-click), refer to my previous update below
Update #1,Jan 29 : Disregard my previous post. I've though about the way you worded the problem : "a gui front end to locate". In fact there exists a gui front end to scripts , zenity
, and I've used it to make a rough draft of a script that might be useful. Feel free to alter it and add functionality, but at the most basic level it's locate with gui.
As for making a script "double-clickable" refer here
The script
#!/bin/bash
FOUND=0
USRFILE=`zenity --entry --entry-text="Text here" --text="Enter a filename or part of it"`
zenity --info --text " Please wait a little, I'll try to find it "
locate $USRFILE > results.txt && zenity --text-info --html --filename='results.txt'
if [ -e results.txt ]
then FOUND=1
rm results.txt
fi
if [ $FOUND != 1 ]
then zenity --info --text="Nothing found"
fi
Screenshots
Old post
There is gnome-search-tool
, which I've checked with ps
and htop
utilities and it doesn't take too many resources. You can install it with sudo apt-get install gnome-search-tool
.
gnome-search-tool