tsearch function - gtomb - tomb gtk frontend in zenity HTML git clone git://parazyd.org/gtomb.git DIR Log DIR Files DIR Refs DIR README DIR LICENSE --- DIR commit a7b83dff9f0e6e51dee13710d35936ee26cc1fb9 DIR parent 35184479140e0fc970fd92ad36af31f5a92a855b HTML Author: parazyd <parazyd@dyne.org> Date: Tue, 29 Dec 2015 16:45:11 +0100 search function Diffstat: M gtomb | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) --- DIR diff --git a/gtomb b/gtomb t@@ -926,8 +926,28 @@ function _index { # }}} # {{{ search - searches the contents of indexed tombs - _zeninfo "Sorry" "Not implemented yet." - exec _main +function _search { + strings="" + + function _searchstring { + srchstring=`_zenentry "Search" "Enter an argument to search. Cancel to finish."` + res=$? + strings="$strings $srchstring" + + if [[ $res == "1" ]]; then + tombtmp="/tmp/tombtmp" + $TOMBPATH search $strings > $tombtmp + #cat $tombtmp | \ + zenity \ + --text-info \ + --title="Search results" \ + --filename=$tombtmp + else + _searchstring + fi + } + _searchstring +} # }}} if [ ! -f $TOMBPATH ]; then