listen.el icon indicating copy to clipboard operation
listen.el copied to clipboard

Progress/"scrub" bar

Open kaibagley opened this issue 1 month ago • 7 comments

Hey!

Wondering how you would feel about a PR adding a simple Unicode progress bar, for example:

3:12 ████▎ 6:00 (Imagine this but with the blocks propertised with a background colour)

Or similar, the above uses Unicode "block elements".

Fair enough if you don't want this, it's something that I am missing from traditional music players. It's much easier (for me) to imagine how far through the song I am using a bar like this rather than just seeing the time remaining.

kaibagley avatar Nov 25 '25 03:11 kaibagley

Yeah, that seems like a good idea. But rather than implementing the progress bar yourself, I'd suggest checking out some of the packages on ELPA that do something similar. For example, the svg-lib library draws various kinds of progress indicators; I use it in https://github.com/alphapapa/hammy.el

alphapapa avatar Nov 26 '25 02:11 alphapapa

Oh wow, that's an amazing library. I'll definitely be looking into that

kaibagley avatar Nov 26 '25 06:11 kaibagley

Here's a quick first try (don't mind the altered transient):

Image

Pretty easy to also allow Unicode or even just ascii if the user would prefer it

kaibagley avatar Nov 26 '25 15:11 kaibagley

Yeah that looks really nice there. The challenge may be to keep the transient updating automatically.

I'd also like to see what it looks like in the mode line lighter. Maybe we could have one option for a bar and another for a "pie", which takes up less horizontal space.

alphapapa avatar Nov 26 '25 23:11 alphapapa

I think it would be best if the transient track info display was decoupled from the mode line lighter, then we can have the bar in transient, and the pie in the mode line. Or are you set on keeping them the same?

kaibagley avatar Nov 28 '25 04:11 kaibagley

I don't know if this is a good approach or not, but I can get the transient menu to auto-update if I put a timer object into listen-menu's symbol, then add a body to listen-menu according to the transient docs, which removes old timers, and puts a new timer into the listen-menu symbol that calls transient--show. Can just put it in a normal variable but I thought it was cool that you can use the function and variable parts of a symbol like this

https://github.com/kaibagley/listen.el/blob/ead35705f5dacada18d0daf421c1fa484616cbd9/listen.el#L431-L552

kaibagley avatar Nov 28 '25 07:11 kaibagley

I think that decoupling them is probably fine. If we do it cleverly then they can share some code maybe.

That seems like a nice way to handle updating the transient too.

alphapapa avatar Nov 29 '25 04:11 alphapapa

I've noticed you added a status buffer which I like the idea of. I'll add a progress indicator to that buffer too. How do you feel about displaying cover art in this buffer too?

kaibagley avatar Nov 30 '25 05:11 kaibagley

Yeah, cover art in the status buffer makes sense.

As we add more items to it, I think we may want to add some simple customization, i.e. a list of functions to call in that buffer, each function adding a line with its item, which would allow users to omit and reorder them. What do you think?

alphapapa avatar Dec 14 '25 09:12 alphapapa

You're thinking unctions like next, prev, play/pause etc? I think that's a good idea, a use case could be when users open emacs only for the purpose of music, they can leave the status buffer open on a seperate workspace or whatever. Then when they want to fast forward, play next etc, they refocus emacs and interact with it in a similar way to a standard player like Spotify

kaibagley avatar Dec 14 '25 11:12 kaibagley