| 1 |
Pop-Up Run Prompt |
| 2 |
================= |
| 3 |
|
| 4 |
This widget's purpose is to give you a pop-up run prompt. This widget requires |
| 5 |
that you bind it. If the bind is pressed, a wibox appears at the bottom of the |
| 6 |
current screen with a run prompt. Once you type the command you want or cancel, |
| 7 |
the wibox vanishes. |
| 8 |
|
| 9 |
This Obvious feature is inspired by ion3's similar run prompt that some users |
| 10 |
like because of the space-saving style it provides. |
| 11 |
|
| 12 |
Settings available: |
| 13 |
------------------- |
| 14 |
- set_opacity: 0-1. Set the opacity of the popping up wibox. Use this if you |
| 15 |
have xcompmgr running and want real transparency. |
| 16 |
- set_prompt_string: The string that is used instead of the default " Run~ " |
| 17 |
for prompting the user to type. |
| 18 |
- set_prompt_font: Sets the font that the user types in. Uses pango markup. |
| 19 |
- set_slide: true/false. False by default. If this setting is on, rather than |
| 20 |
just having the wibox appear and disappear at the bottom of the screen, it |
| 21 |
slides on and off. |
| 22 |
- set_width: 0-1. Percentage width of screen edge. |
| 23 |
- set_height: number. Height of the run prompt, in pixels. |
| 24 |
- set_border_width: number: Width of border in pixels. |
| 25 |
- set_move_speed: number (in seconds): how fast each step of movement happens |
| 26 |
when the wibox is sliding up/down. |
| 27 |
- set_move_amount: number (in pixels): how many pixels the wibox moves per |
| 28 |
step (set by move_speed) |
| 29 |
- run_function: function: this function gets the input data as its argument, |
| 30 |
default is awful.util.spawn |
| 31 |
- completion_function: function: this function is used for completion, |
| 32 |
default is awful.completion.shell |
| 33 |
|
| 34 |
To set one of these settings, simply do something like: |
| 35 |
|
| 36 |
```lua |
| 37 |
local popup = require("obvious.popup_run_prompt") |
| 38 |
popup.set_opacity(0.7) |
| 39 |
``` |
| 40 |
|
| 41 |
Implementation: |
| 42 |
--------------- |
| 43 |
To use it, include it into your rc.lua by inserting this line: |
| 44 |
|
| 45 |
```lua |
| 46 |
local popup = require("obvious.popup_run_prompt") |
| 47 |
``` |
| 48 |
|
| 49 |
Then add a bind to pop up the run prompt in your binds. Bind syntax changes, |
| 50 |
but it is roughly: |
| 51 |
|
| 52 |
```lua |
| 53 |
awful.key({ modkey }, "r", popup.run_prompt), |
| 54 |
``` |