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 Shows and controls alsa volume.
3 myvolume = lain.widgets.alsa()
5 * Left click: Launch `alsamixer` in your `terminal`.
6 * Right click: Mute/unmute.
7 * Scroll wheel: Increase/decrase volume.
9 The function takes a table as optional argument, which can contain:
11 Variable | Meaning | Type | Default
13 `channel` | Mixer channel | string | "Master"
14 `step` | Step at which volume is increased/decreased | string | "1%"
15 `header` | Text to show before value | string | " Vol "
16 `header_color` | Header color | string | `beautiful.fg_normal` or "#FFFFFF"
17 `color` | Value color | string | `beautiful.fg_focus` or "#FFFFFF"
19 and outputs the following table:
21 Variable | Meaning | Type
23 `widget` | The widget | `wibox.widget.textbox`
24 `channel` | Alsa channel | string
25 `step` | Increase/decrease step | string
26 `notify` | Update `widget` | function
28 Finally, you can control the widget with key bindings like these:
31 awful.key({ altkey }, "Up",
33 awful.util.spawn("amixer sset " .. volume.channel .. " " .. volume.step .. "+")
36 awful.key({ altkey }, "Down",
38 awful.util.spawn("amixer sset " .. volume.channel .. " " .. volume.step .. "-")
41 awful.key({ altkey }, "m",
43 awful.util.spawn("amixer set Master playback toggle")
46 awful.key({ altkey, "Control" }, "m",
48 awful.util.spawn("amixer set Master playback 100%", false )
52 where `altkey = "Mod1"`.