1.5 KiB
1.5 KiB
layout |
---|
page |
Translate Shell
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]({{'/assets/img/screenshots/translate-shell.gif' | relative_url }}){:.center-image}
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
-
Clone repo under ~/.config/awesome/
git clone https://github.com/streetturtle/awesome-wm-widgets.git ~/.config/awesome/
-
Get an API key and paste it in translate.lua as value of the
API_KEY
variable -
Require widget in rc.lua:
local translate = require("awesome-wm-widgets.translate-widget.translate")
-
Add a shortcut to run translate prompt:
awful.key({ modkey }, "c", function() translate.show_translate_prompt() end, { description = "run translate prompt", group = "launcher" } ),