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 with a progressbar.
5 - alsa-utils (of course)
7 Plus tooltips, notifications, and color changes at mute/unmute switch.
9 myvolumebar = lain.widgets.alsabar()
11 * Left click: Launch `alsamixer` in your `terminal`.
12 * Right click: Mute/unmute.
13 * Scroll wheel: Increase/decrase volume.
15 The function takes a table as optional argument, which can contain:
17 Variable | Meaning | Type | Default
19 `width` | Bar width | int | 63
20 `height` | Bar height | int | 1
21 `ticks` | Set bar ticks on | boolean | true
22 `ticks_size` | Ticks size | int | 7
23 `vertical` | Set the bar vertical | boolean | false
24 `channel` | Mixer channel | string | "Master"
25 `step` | Step at which volume is increased/decreased | string | "5%"
26 `colors` | Bar colors | table | see **colors**
27 `notifications` | Notifications settings | table | see **notifications**
31 Variable | Meaning | Type | Default
33 `background` | Bar backgrund color | string | `beautiful.bg_normal`
34 `mute` | Bar mute color | string | "#EB8F8F"
35 `unmute` | Bar unmute color | string | "#A4CE8A"
39 Variable | Meaning | Type | Default
41 `font` | Notifications font | string | The one defined in `beautiful.font`
42 `font_size` | Notifications font size | string | "11"
43 `bar_size` | Wibox height | int | 18
45 It's **crucial** to set `notifications.bar_size` to your `mywibox[s]` height,
46 **if** you have set it different than default (18).
48 `lain.widgets.alsabar` outputs the following table:
52 `widget` | `awful.widget.progressbar`
57 Finally, you can control the widget with key bindings like these:
60 awful.key({ altkey }, "Up",
62 awful.util.spawn("amixer sset " .. volume.channel .. " " .. volume.step .. "+")
65 awful.key({ altkey }, "Down",
67 awful.util.spawn("amixer sset " .. volume.channel .. " " .. volume.step .. "-")
70 awful.key({ altkey }, "m",
72 awful.util.spawn("amixer set Master playback toggle")
75 awful.key({ altkey, "Control" }, "m",
77 awful.util.spawn("amixer set Master playback 100%", false )
81 where `altkey = "Mod1"`.