summaryrefslogtreecommitdiff
path: root/translate-widget/README.MD
diff options
context:
space:
mode:
authorstreetturtle <streetturtle@gmail.com>2018-01-21 16:27:19 -0500
committerstreetturtle <streetturtle@gmail.com>2018-01-21 16:27:19 -0500
commit26d795ee795358cdf81be88f82bc822e5b5b3a4f (patch)
tree374fd58477949effafe7bc51641c06027b28d08b /translate-widget/README.MD
parent26bf019c910790b52396ffa2418cee0c3bee402e (diff)
few changes
Diffstat (limited to 'translate-widget/README.MD')
-rw-r--r--translate-widget/README.MD38
1 files changed, 4 insertions, 34 deletions
diff --git a/translate-widget/README.MD b/translate-widget/README.MD
index 498b36e..bff749f 100644
--- a/translate-widget/README.MD
+++ b/translate-widget/README.MD
@@ -13,46 +13,16 @@ This widget allows quickly translate words or phrases without opening a browser
## Installation
1. Clone repo under **~/.config/awesome/**
-1. Get an [API key](https://translate.yandex.com/developers/keys) and paste it in **secrets.lua**
-1. Require widget and secrets in **rc.lua**:
+1. Get an [API key](https://translate.yandex.com/developers/keys) and paste it in **translate.lua** as value of the `API_KEY` variable
+1. Require widget in **rc.lua**:
```lua
- local secrets = require("awesome-wm-widgets.secrets")
local translate = require("awesome-wm-widgets.translate-widget.translate")
```
-1. Create a translate prompt, just under `mypromptbox`:
+1. Add a shortcut to run translate prompt (note that we pass an API key from secrets.lua in method call):
```lua
- s.mypromptbox = awful.widget.prompt()
- s.translateprompt = awful.widget.prompt()
- ```
-
-1. Add it to the left widgets of the wibox, just after `mypromptbox`:
-
- ```lua
- -- Add widgets to the wibox
- s.mywibox:setup {
- layout = wibox.layout.align.horizontal,
- { -- Left widgets
- layout = wibox.layout.fixed.horizontal,
- mylauncher,
- s.mytaglist,
- s.mypromptbox,
- s.translateprompt,
- },
- ```
-
-1. Add a shortcut to run this prompt (note that we pass an API key from secrets.lua in method call):
-
- ```lua
- awful.key({ modkey }, "c", function()
- awful.prompt.run {
- prompt = "trnslt: ",
- textbox = awful.screen.focused().translateprompt.widget,
- exe_callback = function(text)
- translate.translate(text, secrets.translate_widget_api_key)
- end
- }
+ awful.key({ modkey }, "c", function() translate.show_translate_prompt() end, { description = "run translate prompt", group = "launcher" }),
```