If you use ROX Filer

Submitted by whirlpool on Wed, 15/12/2004 - 13:42.
( categories: )

Several months ago I wrote this ugly bash script to supplement my favourite file manager, ROX.

This script pops up a text entry box, using zenity for your search term. It will then use find to find the files in your home directory, /home/pub, and cdrom. It then creates a temporary folder with symlinks to the matching files, and opens it with ROX.

#!/bin/bash

autosymlinks () 
{
        dir_path=`mktemp -d ~/tmp/gxsearch.XXXXXXX`
        find ~/ /home/pub/ /mnt/cdrom -iname "$1" -exec ln -s "{}" $dir_path \; 
        echo $dir_path
}

search_string=`zenity --title="Find files" --entry --text="Enter file name to fi
nd"` &&
{
temp_dir=`autosymlinks "$search_string"` 
rox -n $temp_dir &&
rm -fvr $temp_dir
}

I would rather use locate than find, for speed. But, I don't know how.

You will have to use wild cards, if you write parts of filename in search box. Example *ruins*

Reply





*

  • Allowed HTML tags: <a> <b> <dd> <dl> <dt> <i> <li> <ol> <ul> <pre> <blockquote> <img> <ins> <del> <br> <div> <span> <em> <h1> <h2> <h3> <h4> <h5> <h6> <code> <p> <hr>
  • You can insert tables with comma separated values (CSV) into the text, they will be automatically converted to appropriate HTML-tables.
  • You may link to images on this site using a special syntax
  • You can embed nodes within other nodes using the following syntax:
    [node:node_id,param_1="val1",param_2="val2"]
  • You may write mixed Arabic and English freely, line direction will be computed automaticaly
  • Glossary terms will be automatically marked with links to their descriptions