]> 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 sysload (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 and 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 `width` | Bar width | int | 63
16 `height` | Bar height | int | 1
17 `ticks` | Set bar ticks on | boolean | true
18 `ticks_size` | Ticks size | int | 7
19 `vertical` | Set the bar vertical | boolean | false
20 `channel` | Mixer channel | string | "Master" 
21 `step` | Step at which volume is increased/decreased | string | "5%"
22 `colors` | Bar colors | table | see **colors**
23 `notifications` | Notifications settings | table | see **notifications**
24
25 ### colors
26
27 Variable | Meaning | Type | Default
28 --- | --- | --- | ---
29 `background` | Bar backgrund color | string | `beautiful.bg_normal`
30 `mute` | Bar mute color | string | "#EB8F8F"
31 `unmute` | Bar unmute color | string | "#A4CE8A"
32
33 ### notifications
34
35 Variable | Meaning | Type | Default
36 --- | --- | --- | ---
37 `font` | Notifications font | string | The one defined in `beautiful.font`
38 `font_size` | Notifications font size | string | "11"
39 `color` | Notifications color | string | `beautiful.fg_focus`
40 `bar_size` | Wibox height | int | 18
41
42 It's **crucial** to set `notifications.bar_size` to your `mywibox[s]` height,
43 **if** you have set it different than default (18). 
44
45 ### output table
46
47 Variable | Meaning | Type
48 --- | --- | ---
49 `widget` | The widget | `awful.widget.progressbar`
50 `channel` | Alsa channel | string
51 `step` | Increase/decrease step | string
52 `notify` | The notification | function
53
54 You can control the widget with key bindings like these:
55
56     -- Volume control
57     awful.key({ altkey }, "Up",
58     function ()
59         awful.util.spawn("amixer sset " .. volume.channel .. " " .. volume.step .. "+")
60         volume.notify()
61     end),
62     awful.key({ altkey }, "Down",
63     function ()
64         awful.util.spawn("amixer sset " .. volume.channel .. " " .. volume.step .. "-")
65         volume.notify()
66     end),
67     awful.key({ altkey }, "m",
68     function ()
69         awful.util.spawn("amixer set Master playback toggle")
70         volume.notify()
71     end),
72     awful.key({ altkey, "Control" }, "m", 
73     function ()
74         awful.util.spawn("amixer set Master playback 100%", false )
75         volume.notify()
76     end),
77
78 where `altkey = "Mod1"`.