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 progressbar; provides tooltips, notifications, and color changes at mute/unmute switch.
5 volume = lain.widgets.alsabar()
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 `timeout` | Refresh timeout seconds | int | 4
16 `settings` | User settings | function | empty function
17 `width` | Bar width | int | 63
18 `height` | Bar height | int | 1
19 `ticks` | Set bar ticks on | boolean | true
20 `ticks_size` | Ticks size | int | 7
21 `vertical` | Set the bar vertical | boolean | false
22 `channel` | Mixer channel | string | "Master"
23 `step` | Step at which volume is increased/decreased | string | "5%"
24 `colors` | Bar colors | table | see **colors**
25 `notifications` | Notifications settings | table | see **notifications**
29 Variable | Meaning | Type | Default
31 `background` | Bar backgrund color | string | `beautiful.bg_normal`
32 `mute` | Bar mute color | string | "#EB8F8F"
33 `unmute` | Bar unmute color | string | "#A4CE8A"
37 Variable | Meaning | Type | Default
39 `font` | Notifications font | string | The one defined in `beautiful.font`
40 `font_size` | Notifications font size | string | "11"
41 `color` | Notifications color | string | `beautiful.fg_focus`
42 `bar_size` | Wibox height | int | 18
44 It's **crucial** to set `notifications.bar_size` to your `mywibox[s]` height.
46 `settings` can use the integer `alsa_level` and `alsa_status`.
50 Variable | Meaning | Type
52 `bar` | The widget | `awful.widget.progressbar`
53 `channel` | Alsa channel | string
54 `step` | Increase/decrease step | string
55 `notify` | The notification | function
57 You can control the widget with key bindings like these:
59 -- ALSA volume control
60 awful.key({ altkey }, "Up",
62 awful.util.spawn("amixer -q set " .. volume.channel .. " " .. volume.step .. "+")
65 awful.key({ altkey }, "Down",
67 awful.util.spawn("amixer -q set " .. volume.channel .. " " .. volume.step .. "-")
70 awful.key({ altkey }, "m",
72 awful.util.spawn("amixer -q set " .. volume.channel .. " playback toggle")
75 awful.key({ altkey, "Control" }, "m",
77 awful.util.spawn("amixer -q set " .. volume.channel .. " playback 100%")
81 where `altkey = "Mod1"`.