awesome-wm-widgets/translate-widget
Pavel Makhov 90d1836ec9 show shell on focused screen and enable history 2018-11-05 17:03:11 -05:00
..
README.MD Update README.MD 2018-01-21 16:29:13 -05:00
demo.gif update demo gif 2018-01-21 16:19:36 -05:00
demo1.gif update demo gif 2018-01-21 16:19:36 -05:00
translate.lua show shell on focused screen and enable history 2018-11-05 17:03:11 -05:00

README.MD

Translate Widget

This widget allows quickly translate words or phrases without opening a browser - just using Awesome. To provide direction of the translation add the 2 letters code of the source and target languages at the end of the phrase, for example hello enfr will translate hello from English to French. This widget is based on Yandex.Translate API.

demo

Controls

  • Mod4 + c - opens a translate prompt;
  • left click on the popup widget - copies the translation to the clipboard and closes widget;
  • right click on the popup widget - copies text to translate to the clipboard and closes widget.

Installation

  1. Clone repo under ~/.config/awesome/

  2. Get an API key and paste it in translate.lua as value of the API_KEY variable

  3. Require widget in rc.lua:

    local translate = require("awesome-wm-widgets.translate-widget.translate")
    
  4. Add a shortcut to run translate prompt:

    awful.key({ modkey }, "c", function() translate.show_translate_prompt() end, { description = "run translate prompt", group = "launcher" }),