python - Send selected text to a command line argument -
I found this utility, which translates different languages into each other using Google's translation API. It really works according to the description.
Although I have got sick to choose a word that does not understand, then middle-click it in the command. The command format is as follows:
pytranslate WORD
Is there a program / script that can be detected in when I select a word, or a series of words with my mouse, and then Select the above command instead of WORD in a terminal window Runs with the text?
Example:
Selected Text:
Bonjour Mondial ...
Result as a result / result:
>
#! / Bin / bash pytranslate "$ (xsel -p)"
Now just put it in ~ / bin
(make sure your path is included) , And run it. (You may need to install the XSL package.) This primary selection will take the current content of the buffer and pass it on the patentl.
If you want it as a button, use a bash read command to create a launcher that runs it on a terminal, and to "press ENTER to continue" .
Comments
Post a Comment