Thunar es el explorador de archivos por defecto del entorno de escritorio para Unix/GNU/Linux Xfce que además de ser intuitivo es muy cómodo, ligero y fácil de usar. A pesar de que los desarrolladores están añadiéndole nuevas características como por ejemplo gestos de ratón, aún le faltan accesorios básicos como por ejemplo: un buscador. Es por ello que mediante este tip vamos a crear uno el cual tendremos disponible en el menú contextual que nos aparece al oprimir el clic derecho como se ve en la imagen posterior.

Código :
$ sudo aptitude install zenity
Código :
$ mkdir ~/.bash-scripts/
Código :
$ mousepad ~/.bash-scripts/search-for-files
Código :
#!/bin/bash
#search-for-files
# change this figure to suit yourself - I find zenity dies from about 1000 results but YMMV
maxresults=500
# again, change the path to the icon to suit yourself. But who doesn't like tango?
window_icon="/usr/share/icons/Tango/scalable/actions/search.svg"
# this script will work for any environment that has bash and zenity, so the filemanager is entirely down to you! you can add extra arguments to the string as long as the last argument is the path of the folder you open
filemanager="thunar"
window_title="Search for Files"
srcPath="$*"
if ! [ -d "$srcPath" ] ; then
cd ~/
srcPath=`zenity --file-selection --directory --title="$window_title - Look in folder" --window-icon="$window_icon"`
fi
if [ -d "$srcPath" ] ; then
fragment=`zenity --entry --title="$window_title - Name contains:" --window-icon="$window_icon" --text="Search strings less than 2 characters are ignored"`
if ! [ ${#fragment} -lt 2 ] ; then
(
echo 10
O=$IFS IFS=$'\n' files=( `find "$srcPath" -iname "*$fragment*" -printf \"%Y\"\ \"%f\"\ \"%k\ KB\"\ \"%t\"\ \"%h\"\\\n | head -n $maxresults` ) IFS=$O
echo 100
selected=`eval zenity --list --title=\"${#files[@]} Files Found - $window_title\" --window-icon="$window_icon" --width="600" --height="400" --text=\"Search results:\" --print-column=5 --column \"Type\" --column \"Name\" --column \"Size\" --column \"Date modified\" --column \"Path\" ${files[@]}`
if [ -e "$selected" ] ; then "$filemanager" "$selected" ; fi
) | zenity --progress --auto-close --pulsate --title="Searching..." --window-icon="$window_icon" --text="Searching for \"$fragment\""
fi
fi
exit
Código :
$ sudo chmod a+x ~/.bash-scripts/search-for-files
Código :
$ sudo cp /etc/xdg/Thunar/uca.xml /etc/xdg/Thunar/uca.xml.old
Código :
<action> <icon>/usr/share/icons/Tango/scalable/actions/search.svg</icon> <name>Search for Files</name> <command>bash ~/.bash-scripts/search-for-files %f</command> <description>Search this folder for files</description> <patterns>*</patterns><directories/> </action>