LocnRox (Enhanced with Vovchik)

Stuff that has yet to be sorted into a category.
Post Reply
Message
Author
seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#16 Post by seaside »

Bert wrote:
seaside wrote:vovchik,
Those attached Puppies are all so good, it's very hard to pick one. Although my wife likes the last one the best. :D
s
So do I!
Looks a bit like my sister when she was younger :)

Dog 1 is not receiving enough nourishment
Dog 2 looks like my brother-in-law when he gets nervous
Dog 3 needs a special-care kennel
:lol:
Bert,

Do we have any assurances that you are in fact a human?

(There have been rumors floating around that real puppies are trolling the internet and speaking their thoughts on family members and others :D :D )

Regards,
s
(Confidentially, my brother-in-law reminds me of that "king Charles" spaniel model) :D

User avatar
Keef
Posts: 987
Joined: Thu 20 Dec 2007, 22:12
Location: Staffordshire

#17 Post by Keef »

seaside,

No joy with the older version.
Tried the latest one on slaxer and 301X where it worked, but it didn't on 3.01.
After finding out that Tinylogin was part of Busybox, I installed the busybox-20090725.pet to see what happened. It solved the 'addgroup' problem, but... still no dialog box or gyrating puppies.

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#18 Post by seaside »

Keef wrote:seaside,

No joy with the older version.
Tried the latest one on slaxer and 301X where it worked, but it didn't on 3.01.
After finding out that Tinylogin was part of Busybox, I installed the busybox-20090725.pet to see what happened. It solved the 'addgroup' problem, but... still no dialog box or gyrating puppies.
Keef,

Ah...... I'm sorry it's not working and I'm at a loss to think of anything else to try.

Not to lead you off this, but have you tried "searchmonkey", it's not an indexed search, yet it's reasonable fast and well featured.

Wait.. one more idea .... Gtkdialog versions...the puppy 4 has Gtkdialog3 - perhaps yours have earlier ones.

Cheers,
s

rollo5
Posts: 4
Joined: Thu 07 Mar 2013, 18:56

multiple keywords support

#19 Post by rollo5 »

Hello seaside,

thank you for this little tool. For a long time I was looking for something like this. My needs are: fast search, open the filemanager on clicking, multiple keywords, possibility to sort files for filename, date and size.

I added support for multiple keyword search. Now you can type in for example "spot dir" (without quotes) and it shows you all files with spot and dir in the filename. Of course you can search for extensions like "firefox png".

Code: Select all

#! /usr/sbin/gtkdialog3 -e

# ------------------
# PROGRAM:	locnRox (pfilefind)
# AUTHORS:	Seaside (locnrox) and Vovchik
# PURPOSE:	GUI to find files
# DEPENDS:	bash, gtkdialog, showsplash, Mlocate
# PLATFORM:	Linux
# DATE:		29 September
# VERSION:	v.0.1a
# ------------------

# ------------------------
# INITIALIZATION
# ------------------------

## gtkdialog3 has to be linked to gtkdialog in usr/sbin

if [ ! -f /usr/sbin/gtkdialog ]; then ln -s /usr/sbin/gtkdialog3 /usr/sbin/gtkdialog ; fi 

TITLE="LocnRox"
VERSION="V. 0.1a"

PFILEFIND_HELP_TEXT="
<b>LocnRox</b> helps you to find files on your storage media \
(hard disks, USB sticks, main file system) using the <b>Mlocate</b> utility. 

<b>Operation:</b>
  
1. First, mount the drives you wish to catalogue and press the <b>Update</b> \
button to create the mlocate database. Once you have done this <i>- and \
this procedure may take up to five minutes with a lot of partitions \
mounted -</i> , you can search for files.

2. Enter a file name or partial file name (wildcards - * - are permitted) in \
the <b>Input Box</b>.

3. Press the <b>Search</b> button. 

4. The program will search its database and present you with a list \
of matching files. When you click on a file name in the list, the program \
will launch <b>Rox Filer</b> in that file's directory.

5. To exit the program, press the <b>Cancel</b> button."

# ------------------------
# END INITIALIZATION
# ------------------------


# ------------------------
# FUNCTIONS
# ------------------------

# ------------------------
function findfiles()
# ------------------------
{
# added support for multiple keywords: first word is searched by locate. The
# output is saved to the file "search_$key_word_number". Now grep searches
# the output for the other keywords.


	key_words_array=($ENTRY)

	typeset -i key_word_number=0
	typeset -i old_key_word_number
	typeset -i key_words_array_size_minus_one

	locate -i ${key_words_array[$key_word_number]} > /tmp/search_$key_word_number

	key_words_array_size_minus_one=${#key_words_array[@]}-1

	while [ $key_word_number -lt $key_words_array_size_minus_one ]
	do
		old_key_word_number=$key_word_number
		key_word_number=$key_word_number+1
		grep -i ${key_words_array[$key_word_number]} /tmp/search_$old_key_word_number > /tmp/search_$key_word_number
	done

	mv /tmp/search_$key_word_number /tmp/locatefoundfiles

#	./bin/locate "$ENTRY" | sort > /tmp/locatefoundfiles
}	

# ------------------------
function roxview()
# ------------------------
{
	rox -s "$FILE"
}

# ------------------------
function dbupdate()
# ------------------------
{	
	var1="./img/dog-pup-tailwag.gif"
	var2="<b>Indexing files. Please be patient</b>"
	var3="LocnRox Update"
	./bin/showsplash "$var1" "$var2" "$var3"&
	./bin/updatedb
	killall showsplash
}

# ------------------------
# END FUNCTIONS
# ------------------------

# ------------------------
#  HELP WINDOW	 
# ------------------------
	
export PFILEFIND_HELP_DIALOG='
<window title="LocnRox Help" icon-name="gtk-help">
	<vbox>
		<pixmap>
			<input file>"./img/logo.png"</input>
		</pixmap>
		<text use-markup="true"> 
			<label>"<b>'$TITLE' HELP</b>"</label> 
		</text>
		<frame>
		<text use-markup="true" wrap="true">
			<label>"'$PFILEFIND_HELP_TEXT'"</label>
		</text>
		</frame>
		<hbox>
			<button cancel>
				<action>closewindow:PFILEFIND_HELP_DIALOG</action>
			</button>
		</hbox>
	</vbox>
</window>
'
# ------------------------
#  MAIN WINDOW	 
# ------------------------

export MAIN_DIALOG='
<window title="LocnRox" decorated="true" window_position="1" icon-name="gtk-find">
	<vbox>
		<frame>
			<pixmap>
				<input file>"./img/logo.png"</input>
			</pixmap>
			<vbox> 
				<text use-markup="true"> 
					<label>"<b>'$TITLE'</b>"</label> 
				</text> 
				<text use-markup="true"> 
					<label>"<i>Locate file and launch Rox Filer</i>"</label> 
				</text>
				<text use-markup="true"> 
					<label>"<b>'$VERSION'</b>"</label> 
				</text> 
			</vbox>
		</frame>
		<frame>
			<hbox>
      			<text>
        			<label>Search term:</label>
      			</text>
					<entry activates-default="true">
					<default>Enter search term</default>
					<variable>ENTRY</variable>
					</entry>
				<button can-default="true" has-default="true">
					<input file>"./img/find.png"</input>
					<label>Search</label>
					<action>findfiles</action>
					<action>refresh:FILE</action>
				</button>
			</hbox>
		</frame>
		<frame Choose your file>
			<tree headers_visible="false" rules_hint="true">
				<label>Found files</label>
				<height>250</height><width>500</width>
				<input>cat /tmp/locatefoundfiles</input>	
				<variable>FILE</variable>
				<action>roxview</action>	
			</tree>
		</frame>
		<hbox>
			<button help>
				<action>launch:PFILEFIND_HELP_DIALOG</action>
			</button>
			<button>
				<input file>"./img/go.png"</input>
				<label>Update DB</label>
				<action>dbupdate</action>
			</button>
			<button cancel>
				<action type="exit">QUIT</action> 
			</button>
		</hbox>
	</vbox>
</window>
'

I'm a beginner in bash scripting - maybe there is a better solution.

If i have time I would make the sorting feature (sorting by size and date). Do you have an I idea how I could make this?

regards, rollo

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

Re: multiple keywords support

#20 Post by seaside »

rollo5 wrote:Hello seaside,

If i have time I would make the sorting feature (sorting by size and date). Do you have an I idea how I could make this?

regards, rollo
rollo,

Nice enhancement.

Rox has some nice built-in SOAP RPC facilities for invoking sort functions as described in the Rox manual.

http://rox.sourceforge.net/Manual/Manua ... .html#soap

For example to sort by date -

Code: Select all

rox --RPC << EOF
<?xml version="1.0"?>
<env:Envelope xmlns:env="http://www.w3.org/2001/12/soap-envelope">
 <env:Body xmlns="http://rox.sourceforge.net/SOAP/ROX-Filer">
  <OpenDir>
   <Filename>/mnt/sdb6</Filename>
   <Sort>Date</Sort>
  </OpenDir>
 </env:Body>
</env:Envelope>
EOF
Cheers,
s

Post Reply