All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
1 [<- widgets](https://github.com/copycat-killer/lain/wiki/Widgets)
3 Shows and controls alsa volume with a textbox.
5 myvolume = lain.widgets.alsa()
7 * Left click: Launch `alsamixer` in your `terminal`.
8 * Right click: Mute/unmute.
9 * Scroll wheel: Increase/decrase volume.
11 The function takes a table as optional argument, which can contain:
13 Variable | Meaning | Type | Default
15 `channel` | Mixer channel | string | "Master"
16 `step` | Step at which volume is increased/decreased | string | "1%"
17 `header` | Text to show before value | string | " Vol "
18 `header_color` | Header color | string | `beautiful.fg_normal` or "#FFFFFF"
19 `color` | Value color | string | `beautiful.fg_focus` or "#FFFFFF"
20 `footer` | Text to append after value | string | " "
22 *Note*: `footer` can be markup text.
24 `lain.widgets.alsa` outputs the following table:
26 Variable | Meaning | Type
28 `widget` | The widget | `wibox.widget.textbox`
29 `channel` | Alsa channel | string
30 `step` | Increase/decrease step | string
31 `notify` | Update `widget` | function
33 Finally, you can control the widget with key bindings like these:
36 awful.key({ altkey }, "Up",
38 awful.util.spawn("amixer sset " .. volume.channel .. " " .. volume.step .. "+")
41 awful.key({ altkey }, "Down",
43 awful.util.spawn("amixer sset " .. volume.channel .. " " .. volume.step .. "-")
46 awful.key({ altkey }, "m",
48 awful.util.spawn("amixer set Master playback toggle")
51 awful.key({ altkey, "Control" }, "m",
53 awful.util.spawn("amixer set Master playback 100%", false )
57 where `altkey = "Mod1"`.