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 mpdwidget = 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 +--------------------------------------------------------+
17 You need a file like this
19 (Front|front|Cover|cover|Art|art|Folder|folder)\.(jpg|jpeg|png|gif)
21 in the album folder in order to show album art too.
25 Variable | Meaning | Type | Default
27 `timeout` | Refresh timeout seconds | int | 1
28 `password` | MPD password | string | ""
29 `host` | MPD server | string | "127.0.0.1"
30 `port` | MPD port | string | "6600"
31 `music_dir` | Music directory | string | "~/Music"
32 `cover_size` | Album art notification size | int | 100
33 `default_art` | Default art | string | ""
34 `settings` | User settings | function | empty function
36 `settings` can use `mpd_now` table, which contains the following string values:
38 - state (possible values: "play", "pause", "stop")
45 and can modify `mpd_notification_preset` table, which will be the preset for the naughty notifications. Check [here](http://awesome.naquadah.org/doc/api/modules/naughty.html#notify) for the list of variables it can contain. Default definition:
47 mpd_notification_preset = {
48 title = "Now playing",
50 text = string.format("%s (%s) - %s\n%s", mpd_now.artist,
51 mpd_now.album, mpd_now.date, mpd_now.title)
56 Variable | Meaning | Type
58 `widget` | The textbox | `wibox.widget.textbox`
59 `update` | The notification | function
61 You can control the widget with key bindings like these:
64 awful.key({ altkey, "Control" }, "Up",
66 awful.util.spawn_with_shell("mpc toggle || ncmpcpp toggle || ncmpc toggle || pms toggle")
69 awful.key({ altkey, "Control" }, "Down",
71 awful.util.spawn_with_shell("mpc stop || ncmpcpp stop || ncmpc stop || pms stop")
74 awful.key({ altkey, "Control" }, "Left",
76 awful.util.spawn_with_shell("mpc prev || ncmpcpp prev || ncmpc prev || pms prev")
79 awful.key({ altkey, "Control" }, "Right",
81 awful.util.spawn_with_shell("mpc next || ncmpcpp next || ncmpc next || pms next")
85 where `altkey = "Mod1"`.