]> git.madduck.net Git - etc/awesome.git/blob - alsabar.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 mpd (markdown)
[etc/awesome.git] / alsabar.md
1 [<- widgets](https://github.com/copycat-killer/lain/wiki/Widgets)
2
3 Shows and controls alsa volume with a progressbar; provides tooltips, notifications, and color changes at mute/unmute switch.
4
5         myvolumebar = lain.widgets.alsabar()
6
7 * Left click: Launch `alsamixer` in your `terminal`.
8 * Right click: Mute/unmute.
9 * Scroll wheel: Increase/decrase volume.
10
11 The function takes a table as optional argument, which can contain:
12
13 Variable | Meaning | Type | Default
14 --- | --- | --- | ---
15 `timeout` | Refresh timeout seconds | int | 4
16 `width` | Bar width | int | 63
17 `height` | Bar height | int | 1
18 `ticks` | Set bar ticks on | boolean | true
19 `ticks_size` | Ticks size | int | 7
20 `vertical` | Set the bar vertical | boolean | false
21 `channel` | Mixer channel | string | "Master" 
22 `step` | Step at which volume is increased/decreased | string | "5%"
23 `colors` | Bar colors | table | see **colors**
24 `notifications` | Notifications settings | table | see **notifications**
25
26 ### colors
27
28 Variable | Meaning | Type | Default
29 --- | --- | --- | ---
30 `background` | Bar backgrund color | string | `beautiful.bg_normal`
31 `mute` | Bar mute color | string | "#EB8F8F"
32 `unmute` | Bar unmute color | string | "#A4CE8A"
33
34 ### notifications
35
36 Variable | Meaning | Type | Default
37 --- | --- | --- | ---
38 `font` | Notifications font | string | The one defined in `beautiful.font`
39 `font_size` | Notifications font size | string | "11"
40 `color` | Notifications color | string | `beautiful.fg_focus`
41 `bar_size` | Wibox height | int | 18
42
43 It's **crucial** to set `notifications.bar_size` to your `mywibox[s]` height,
44 **if** you have set it different than default (18). 
45
46 ### output table
47
48 Variable | Meaning | Type
49 --- | --- | ---
50 `bar` | The widget | `awful.widget.progressbar`
51 `channel` | Alsa channel | string
52 `step` | Increase/decrease step | string
53 `notify` | The notification | function
54
55 You can control the widget with key bindings like these:
56
57     -- Volume control
58     awful.key({ altkey }, "Up",
59     function ()
60         awful.util.spawn("amixer set " .. volume.channel .. " " .. volume.step .. "+")
61         myvolumebar.notify()
62     end),
63     awful.key({ altkey }, "Down",
64     function ()
65         awful.util.spawn("amixer set " .. volume.channel .. " " .. volume.step .. "-")
66         myvolumeba.notify()
67     end),
68     awful.key({ altkey }, "m",
69     function ()
70         awful.util.spawn("amixer set " .. volume.channel .. " playback toggle")
71         myvolumebar.notify()
72     end),
73     awful.key({ altkey, "Control" }, "m", 
74     function ()
75         awful.util.spawn("amixer set " .. volume.channel .. " playback 100%", false )
76         myvolumebar.notify()
77     end),
78
79 where `altkey = "Mod1"`.