Giter VIP home page Giter VIP logo

notitrans's Introduction

notitrans

[🇧🇷] Um script em shell que mostra uma notificação com uma tradução para o texto selecionado.

[🇺🇸] A shell script that shows up a notification with a translation for the selected text.

Dependencies

  • notify-send (this tool is usually already installed on your system): sudo apt install libnotify-bin
  • xsel: sudo apt install xsel
  • translate-shell: sudo apt install translate-shell

How to use it

  • [🇧🇷] Mova o script para um diretório cujo caminho já esteja presente na sua variável de ambiente $PATH;
  • [🇺🇸] Move the script to a directory whose path is in your $PATH variable;
    • Example:

      git clone https://github.com/lyangmdrs/notitrans.git

      cd notitrans

      chmod +x notitrans

      sudo mv notitrans /usr/local/bin/

  • [🇧🇷] Crie um novo atalho de teclado para executar o script;
  • [🇺🇸] Create a new keyboard shortcut to run the script;
    • Example:

How to configure the target language

By default, the target language in the script is Portuguese 🇧🇷. To set another language you need to edit the script in the highlighted part below.

  • notify-send -i emblem-default " Tradução:" "`xsel -o | sed ':a;N;$!ba;s/\n/ /g' | trans -b -t pt`"

In this case pt is the code for Potuguese Language. You can see all the supported languages and their respective codes by typing trans -R in a terminal.

To set the script to translate for Spanish 🇪🇸, for example:

  • notify-send -i emblem-default " Tradução:" "`xsel -o | sed ':a;N;$!ba;s/\n/ /g' | trans -b -t es`"

notitrans's People

Stargazers

Davi Juvêncio avatar Áxel Medeiros avatar Jefferson Lopes avatar Yuri Loia avatar Lucas Fernando Andrade Costa avatar

Watchers

James Cloos avatar Lyang Medeiros avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.