lcpz / lain

Awesome WM complements
GNU General Public License v2.0
1.06k stars 212 forks source link

widget.mpd: add notify function #449

Open ngoonee opened 4 years ago

ngoonee commented 4 years ago

I'm using awesome v4.3 (Too long) on Lua 5.3.5.

How would I trigger the mpd widget's status? I've been trying various permutations of theme.mpd.show() | awesome-client but can't seem to get anything to happen.

lcpz commented 4 years ago

This is an example of how to configure the widget, and this is an example of some keybindings.

You have to use theme.mpd.update() within theme.lua, and beautiful.mpd.update() within rc.lua. Read the wiki for detailed information.

ngoonee commented 4 years ago

Thanks, took a few weeks to try different things, since my config was almost exactly what you linked @lcpz

I don't think this works. theme.mpd.update() doesn't do anything for me. If I happen to do os.execute("mpc next") before it, then the notification shows up, but the same thing happens if I use mpc next in the terminal, so theme.mpd.update() is not doing anything.

Now that I re-read, I realised it may be an error in how I've described things. I'm looking to trigger the naughty notification (which pops up every time a new song plays) at any time.

To be clear - I'm looking for an equivalent to pulsebar's "notify" method. Currently I can run this in an external script:-

echo 'theme.volume.notify()' | awesome.client

And this would bring up the pulsebar notification. Can the same be done with mpd?

lcpz commented 4 years ago

Can the same be done with mpd?

No, mpd does not have a notify function. I will add it ASAP.