Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # navegador="opera"
- # navegador="firefox-trunk --new-tab"
- navegador="/usr/local/firefox/firefox --new-tab"
- # navegador="google-chrome"
- #navegador="google-chrome-beta"
- csearch=""
- fhist="$HOME/.jishosearch.txt"
- scriptcd="$HOME/scripts/"
- if [ -f $fhist ]; then
- csearch=$(cat $fhist)
- fi
- export DISPLAY=:0
- action=$(yad --title="Buscapalabras Web" --center --form --button=TagainiJisho:0 --button=Forvo:2 --button=Goo:4 --button=Jisho:8 --button=Twitter:6 --button=Cancelar:1--item-separator=, --separator="" --entry --text="Busqueda en jisho.org, goo.ne.jp, Tagaini Jisho 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"
- cd "$scriptcd"
- # El script de abajo carga el programa; y usa wmctrl y xdotool para detectar la ventana de la aplicación
- # e introducir el texto de búsqueda -tweet o DM a @freddyncalm para pedirlo.
- ~/scripts/tagainijisho.sh "$action"
- fi
- if [[ $ret -eq 2 ]]; then
- echo "$action" > "$fhist"
- algo=$($navegador "https://es.forvo.com/word/$action");
- fi
- if [[ $ret -eq 4 ]]; then
- echo "$action" > "$fhist"
- algo=$($navegador "https://dictionary.goo.ne.jp/srch/thsrs/${action//+/ }/m0u/");
- fi
- if [[ $ret -eq 8 ]]; then
- echo "$action" > "$fhist"
- algo=$($navegador "https://jisho.org/words/?dict=edict&jap=${action//+/ }");
- fi
- if [[ $ret -eq 6 ]]; then
- echo "$action" > "$fhist"
- busco=${action//+/ }
- algo=$($navegador "https://twitter.com/search/?f=tweets&vertical=default&q=$busco");
- fi
Add Comment
Please, Sign In to add comment