Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # yes/no question
- if zenity --question --text="Do You Want To Upgrade Your .drv Document?"; then
- drive list -m 10000000 >> /home/g0ne_/.drv
- else
- zenity --info --width=560 --title="Begining .. " --timeout 20 --text="<b>Please Wait:</b>"
- fi
- function menu {
- # Input Dialog
- input=$(zenity --title=" Grep GUI " --width=560 --text " Enter Source and Target" --forms --add-entry "Search_Phrase" --add-entry "Target_Document")
- ret=$?
- # Is clicked exit, then exit.
- [[ $ret -eq 1 ]] && exit 0
- # Error handling source. If nothing was entered return to menu.
- if [ -z "$(echo $input | awk 'BEGIN {FS="|" } { print $1 }')" ]; then
- zenity --width=560 --warning="No Searh Phrase Typed" --text="<b> No Search Specified.</b>\n\n Please Specify Search Phrase. \n\n Back to menu ..."
- menu
- fi
- # Error handling target. If nothing was entered return to menu
- if [ -z "$(echo $input | awk 'BEGIN {FS="|" } { print $2 }')" ]; then
- zenity --width=560 --warning="No target document typed" --text="<b> No target document specified.</b>\n\n Please specify target. EX: /home/$USER/movie.list\n\n Back to menu ..."
- menu
- fi
- }
- menu
- Search_Phrase=$(echo $input | awk 'BEGIN {FS="|" } { print $1 }')
- Target_Document=$(echo $input | awk 'BEGIN {FS="|" } { print $2 }')
- export Search_Phrase
- export Target_Document
- # Pre warning dialog.
- zenity --info --width=560 --height=40 --title="Starting Search.. " --timeout 2 --text="<b> Operation is starting ... Please wait ..... </b>"
- # Start and show a pulsating progressbar.
- grep $Search_Phrase $Target_Document > /tmp/grep | kdialog --title "Results!" --textbox /tmp/grep 5000 400
- # Success dialog.
- zenity --info --width=560 --title="End .. " --timeout 20 --text="<b>Success:</b><span color=\"blue\"> Operation has been successfully finalized.</span> \n\n<b>Searched: $Search_Phrase ------> Target Document: $Target_Document</b>"
- exit 0
- # End here.
- echo ""
- sudo rm /tmp/grep
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement