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 [<- widgets](https://github.com/copycat-killer/lain/wiki/Widgets)
3 Shows MPD status in a textbox.
5 mympd = lain.widgets.mpd()
7 Now playing songs are notified like this:
9 +--------------------------------------------------------+
11 | |/^\_/^\| Now playing |
12 | |\ O O /| Cannibal Corpse (Hammer Smashed Face) - 1993 |
13 | | '.o.' | Hammer Smashed Face (Radio Disney Version) |
15 +--------------------------------------------------------+
21 The function takes a table as optional argument, which can contain:
23 Variable | Meaning | Type | Default
25 `password` | MPD password | string | ""
26 `host` | MPD server | string | "127.0.0.1"
27 `port` | MPD port | string | "6600"
28 `music_dir` | Music directory | string | "~/Music"
29 `refresh_timeout` | Refresh timeout seconds | int | 1
30 `header_color` | Artist value color | string | `beautiful.fg_normal` or "#FFFFFF"
31 `color` | Song value color | string | `beautiful.fg_focus` or "#FFFFFF"
32 `spr` | Separator text between artist and song values | string | " "
33 `footer` | Text to append after values | string | ""
34 `app` | Music program to spawn on click | string | "ncmpcpp"
35 `shadow` | Hide widget when there are no songs playing | boolean | false
37 **Note**: `spr` and `footer` can be markup text.
39 `lain.widgets.mpd` outputs the following table:
41 Variable | Meaning | Type
43 `widget` | The textbox | `wibox.widget.textbox`
44 `notify` | The notification | function
46 Finally, you can control the widget with key bindings like these:
49 awful.key({ altkey, "Control" }, "Up",
51 awful.util.spawn_with_shell("mpc toggle || ncmpcpp toggle || ncmpc toggle || pms toggle")
54 awful.key({ altkey, "Control" }, "Down",
56 awful.util.spawn_with_shell("mpc stop || ncmpcpp stop || ncmpc stop || pms stop")
59 awful.key({ altkey, "Control" }, "Left",
61 awful.util.spawn_with_shell("mpc prev || ncmpcpp prev || ncmpc prev || pms prev")
64 awful.key({ altkey, "Control" }, "Right",
66 awful.util.spawn_with_shell("mpc next || ncmpcpp next || ncmpc next || pms next")
70 where `altkey = "Mod1"`.