]> git.madduck.net Git - etc/awesome.git/blob - alsa.md

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

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.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

f978bce54e6dd86c7c977ff8afd7d64f149fc986
[etc/awesome.git] / alsa.md
1 Shows and controls alsa volume.
2
3         myvolume = lain.widgets.alsa()
4
5 * Left click: Launch `alsamixer` in your `terminal`.
6 * Right click: Mute/unmute.
7 * Scroll wheel: Increase/decrase volume.
8
9 The function takes a table as optional argument, which can contain:
10
11 Variable | Meaning | Type | Default
12 --- | --- | --- | ---
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"
18
19 and outputs the following table:
20
21 Variable | Meaning | Type
22 --- | --- | --- 
23 `widget` | The widget | `wibox.widget.textbox`
24 `channel` | Alsa channel | string
25 `step` | Increase/decrease step | string
26 `notify` | Update `widget` | function
27
28 Finally, you can control the widget with key bindings like these:
29
30     -- Volume control
31     awful.key({ altkey }, "Up",
32     function ()
33         awful.util.spawn("amixer sset " .. volume.channel .. " " .. volume.step .. "+")
34         volume.notify()
35     end),
36     awful.key({ altkey }, "Down",
37     function ()
38         awful.util.spawn("amixer sset " .. volume.channel .. " " .. volume.step .. "-")
39         volume.notify()
40     end),
41     awful.key({ altkey }, "m",
42     function ()
43         awful.util.spawn("amixer set Master playback toggle")
44         volume.notify()
45     end),
46     awful.key({ altkey, "Control" }, "m", 
47     function ()
48         awful.util.spawn("amixer set Master playback 100%", false )
49         volume.notify()
50     end),
51
52 where `altkey = "Mod1"`.