Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- csearch=""
- fhist="$HOME/.jishosearch.txt"
- if [ -f $fhist ]; then
- csearch=$(cat $fhist)
- fi
- export DISPLAY=:0
- action=$(yad --title="Buscapalabras Web" --center --form --button=Goo:0 --button=Jisho:2 --button=Twitter:4 --button=Cancelar:1 --item-separator=, --separator="" --entry --text="Palabras a buscar en jisho.org, goo.ne.jp o Twitter:" --entry-text "$csearch");
- ret=$?
- if [[ $ret -eq 1 ]]; then
- echo "Acción cancelada!!"
- exit 0
- fi
- # Para usar Google Chrome en lugar de Firefox:
- # algo=$(google-chrome "http://jisho.org/words/?dict=edict&jap=$action");
- # Para buscar en el diccionario completo de Goo:
- # algo=$(firefox "http://dictionary.goo.ne.jp/freewordsearcher.html?mode=0&x=0&y=0&kind=all&MT=$action");
- if [[ $ret -eq 0 ]]; then
- echo "$action" > "$fhist"
- algo=$(firefox "http://dictionary.goo.ne.jp/freewordsearcher.html?mode=0&x=0&y=0&kind=thsrs&MT=${action//+/ }");
- fi
- if [[ $ret -eq 2 ]]; then
- echo "$action" > "$fhist"
- algo=$(firefox "http://jisho.org/words/?dict=edict&jap=${action//+/ }");
- fi
- if [[ $ret -eq 4 ]]; then
- echo "$action" > "$fhist"
- algo=$(firefox "http://twitter.com/search/?f=tweets&q=${action//+/ }");
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement