Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save catscury/c701332986e16277476a7f9a25d11ec0 to your computer and use it in GitHub Desktop.
Save catscury/c701332986e16277476a7f9a25d11ec0 to your computer and use it in GitHub Desktop.
Linux translate text in buffer
1 - Устанавливаем обёртку над гугл транслейт
https://github.com/soimort/translate-shell
2 - Устанавливаем необходимые пакеты:
sudo apt-get install libnotify-bin xsel
3 - Создаём файл с именем sel-transl и копируем в него
#!/usr/bin/env bash
notify-send -u critical "$(xsel -o)" "$(xsel -o | trans -no-ansi -b :ru)"
4 - Делаем этот файл исполняемым и перемещаем его в /usr/bin/:
sudo chmod 777 ./seltr && sudo mv ./seltr /usr/bin/
5 - Создаем хоткей System settings->Keyboard->Shortcuts->Custom Shortcuts В поле команды вводить имя файла в /usr/bin/ (команда терминала)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment