summaryrefslogtreecommitdiff
path: root/translate-widget
diff options
context:
space:
mode:
authorstreetturtle <streetturtle@gmail.com>2017-12-27 14:05:50 -0500
committerstreetturtle <streetturtle@gmail.com>2017-12-27 14:05:50 -0500
commit4068d4edf31bfbe1bbd579293285236b5bb36f25 (patch)
tree2392327d240a36f4e062bb9733cb774445ffaa5a /translate-widget
parentd91be91e00ae8f08b974a19a483df804a2ce5cf6 (diff)
update readme
Diffstat (limited to 'translate-widget')
-rw-r--r--translate-widget/README.MD33
1 files changed, 33 insertions, 0 deletions
diff --git a/translate-widget/README.MD b/translate-widget/README.MD
index 230168e..9ba117e 100644
--- a/translate-widget/README.MD
+++ b/translate-widget/README.MD
@@ -9,6 +9,39 @@ This widget is based on the [Yandex.Translate API](https://tech.yandex.com/trans
1. Get an [https://translate.yandex.com/developers/keys](API key)
1.
+Create a translate prompt:
+
+```lua
+s.translateprompt = awful.widget.prompt()
+```
+
+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,
+ },
+```
+
+Add a shortcut to run this prompt:
+
+```lua
+awful.key({ modkey }, "c", function()
+ awful.prompt.run {
+ prompt = "trnslt: ",
+ textbox = awful.screen.focused().translateprompt.widget,
+ exe_callback = function(text)
+ translate.translate(text)
+ end
+ }
+```
## Controls