]> 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:

Updated imap (markdown)
[etc/awesome.git] / alsa.md
1 [<- widgets](https://github.com/copycat-killer/lain/wiki/Widgets)
2
3 Shows and controls alsa volume with a textbox.
4
5         volumewidget = lain.widgets.alsa()
6
7 ### input table
8
9 Variable | Meaning | Type | Default
10 --- | --- | --- | ---
11 `timeout` | Refresh timeout seconds | int | 5
12 `channel` | Mixer channel | string | "Master" 
13 `settings` | User settings | function | empty function
14
15 `settings` can use the following variables:
16
17 Variable | Meaning | Type | Values
18 --- | --- | --- | ---
19 `volume_now.level` | Self explained | int | 0-100
20 `volume_now.status` | Device status | string | "on", "off"
21
22 ### output table
23
24 Variable | Meaning | Type
25 --- | --- | --- 
26 `widget` | The widget | `wibox.widget.textbox`
27 `update` | Update `widget` | function
28
29 You can control the widget with key bindings like these:
30
31     -- Volume control
32     awful.key({ altkey }, "Up",
33     function ()
34         awful.util.spawn("amixer set Master 1%+")
35         volumewidget.update()
36     end),
37     awful.key({ altkey }, "Down",
38     function ()
39         awful.util.spawn("amixer set Master 1%-")
40         volumewidget.update()
41     end),
42     awful.key({ altkey }, "m",
43     function ()
44         awful.util.spawn("amixer set Master playback toggle")
45         volumewidget.update()
46     end),
47     awful.key({ altkey, "Control" }, "m", 
48     function ()
49         awful.util.spawn("amixer set Master playback 100%", false )
50         volumewidget.update()
51     end),
52
53 where `altkey = "Mod1"`.