Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #words
- #!/bin/bash
- #declare -a arr=(`echo $1 | tr -d "\"" | tr -s " ",",","!","?",".","-","—" "\n"`)
- declare -a arr=(`cat /tmp/sub`)
- result=""
- count_arr=${#arr[@]}
- for ((i=0; i<count_arr; i++)) do
- result+="\n${arr[$i]}\t —`sdcv -n -u dictd_www.mova.org_sokrat_enru ${arr[$i]} | head -n6 | tail -n1`"
- done
- command=`cat <<EOF
- local naughty = require("naughty")
- naughty.notify({ position = "top_right", title = "$1", text = "${result}" })
- EOF
- `
- echo "${command}" | awesome-client
- exit 0
- #words2
- #!/bin/bash
- declare -a arr=(`cat /tmp/sub`)
- result=""
- toresult=""
- count_arr=${#arr[@]}
- lstr=0
- lstr_n=0
- lwidth=70
- for ((i=0; i<count_arr; i++)) do
- # if [ ${arr[$i]} == "a" ] || [ ${arr[$i]} == "A" ] || [ ${arr[$i]} == "an" ] || [ ${arr[$i]} == "An" ] || [ ${arr[$i]} == "and" ] || [ ${arr[$i]} == "And" ] || [ ${arr[$i]} == "the" ] || [ ${arr[$i]} == "The" ] || [ ${arr[$i]} == "and" ] || [ ${arr[$i]} == "And" ] || [ ${arr[$i]} == "of" ] || [ ${arr[$i]} == "Of" ] || [ ${arr[$i]} == "should" ] || [ ${arr[$i]} == "Should" ] || [ ${arr[$i]} == "on" ] || [ ${arr[$i]} == "On" ] || [ ${arr[$i]} == "I'm" ] || [ ${arr[$i]} == "Do" ] || [ ${arr[$i]} == "do" ] || [ ${arr[$i]} == "It" ] || [ ${arr[$i]} == "it" ];
- # then arr[$i]=""
- # fi
- case ${arr[$i]} in
- [Aa]|[Aa]"re"|[Aa]m|[Ww]"e've"|[Ww]"hat's"|[Bb]"een"|[Cc]"an't"|[Tt]"hey're"|"I've"|[Ss]"he's"|[Dd]"oes"|"I'd"|[Ww]"on't"|[Aa]"n"|[Aa]"nd"|[Tt]"he"|[Oo]"f"|[Oo]"n"|[Ss]"hould"|[Ww]"ould"|"I'm"|[Ii]"t"|[Dd]"o"|[Uu]"s"|[Aa]"s"|[Cc]"an"|[Ww]"e"|[Yy]"ou"|[Dd]"idn't"|[Dd]"on't"|[Ww]"eren't"|[Gg]"otta"|"'em"|[Gg]"onna"|[Oo]"h"|[Mm]"an"|[Hh]"uh"|"I'll")
- arr[$i]=""
- ;;
- *)
- ;;
- esac
- toresult="` sdcv -n -u quick_english-russian ${arr[$i]} | head -n5 | tail -n1 ` "
- if [[ ${toresult} == *Ничего* ]] ;
- then toresult="_ "
- fi
- # result+="` sdcv -n -u quick_english-russian ${arr[$i]} | head -n5 | tail -n1 ` "
- result+=${toresult}
- lstr=${#result}
- if [[ $lstr -gt $lstr_n+$lwidth ]] ; then
- result+="\n"
- lstr_n=($lstr_n+$lwidth)
- fi
- done
- command=`cat <<EOF
- local naughty = require("naughty")
- naughty.notify({ position = "bottom_middle", text = "${result}" })
- EOF
- `
- echo "${command}" | awesome-client
- exit 0
- #words3
- #!/bin/bash
- googled=`links2 -http.fake-user-agent Mozilla/4.0 -dump https://translate.google.com/translate_a/t?client=p\&text=\`cat /tmp/sub | tr '\n' '+'\`\&sl=en\&tl=ru`
- command=`cat <<EOF
- local naughty = require("naughty")
- naughty.notify({ position = "bottom_middle", text = ${googled} })
- EOF
- `
- echo $command | awesome-client
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement