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