Lokaltog / candybar

WebKit-based status bar for tiling window managers.
Other
225 stars 17 forks source link

widgets/now_playing_mpris: rewrite #84

Open acrisci opened 10 years ago

acrisci commented 10 years ago

Improve render quirks and support configuration-free mpris widget suitable for use with multiple media players.

The widget polls for mpris players. When it finds one, it subscribes to events and updates the player status appropriately.

If no player name is configured, when the player exits, polling starts again for another player.

acrisci commented 10 years ago

Sorry for the rewrite, but this was the easiest way for me to do it given the new things I wrote into the library to make this possible.

I think the configuration-free aspect of this is important because without it, people don't have to know what dbus is. With configuration, people have to know what a dbus interface is.

On that, I would like to see "mpris" taken out of the name, because nobody knows what that is.

Lokaltog commented 10 years ago

Looks great! I'm thinking we could possibly join this widget and now_playing_mpd into a common now_playing widget that attempts to automatically detect any running media player, which works with both mpd and mpris players. It could work without configuration by polling for any player which is "playing" or "paused" ("stopped" should hide the widget), and use the first one it comes across. By doing this we could also use one widget in the theme instead of having it split up.

I'm thinking that we could create a new subdirectory (src/widgets/now_playing), and have separate C files for mpris, mpd and any other players to maintain encapsulation. What do you think?

acrisci commented 10 years ago

I think that makes sense.

I think I am going to add a server class to playerctl so I can write wrappers for the other players. Depending on how that goes, it might be enough to just use the mpris wrappers and only have one widget for mpd, cmus, etc.