Advertisement
constantin-net

rofi-translate-enru-cards

Oct 4th, 2023
915
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.77 KB | None | 0 0
  1. #!/bin/bash
  2. result="$1"
  3. config="$HOME/.config/rofi/config-translate.rasi"
  4. theme="$HOME/.config/rofi/theme-translate.rasi"
  5. card_path="$HOME/cards/"
  6. command="/usr/local/sbin/rofi-1.6.1 -p Перевести -config $config -theme $theme -dmenu"
  7. if [[ -n "$1" && "$1" != *"Найдено"* ]]; then
  8. #    result="$(sdcv -n -u dictd_www.mova.org_sokrat_enru $1)"
  9.     result=$(sdcv -n -u 'LingvoUniversal (En-Ru)' -u dictd_www.mova.org_sokrat_enru -u en-ru-bars "$result")
  10. #    result="$(sdcv -n $1)"
  11.     echo -e "$result" | $command
  12.     card_text=$(echo -e "$result" | head -9 | tail -7)
  13.     convert -background black -fill white -font Tahoma -size 300x250 caption:"$card_text" "$card_path""$1".png
  14. else
  15.     $command -mesg "Введи слово для перевода"
  16. fi
  17. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement