tramhao / termusic

Music Player TUI written in Rust
GNU General Public License v3.0
1.02k stars 43 forks source link

[Feature request] Command line handling #101

Open Dazaisan99 opened 1 year ago

Dazaisan99 commented 1 year ago

Please keep in mind that I have just started using the software.

I'm coming from mocp and I'm just missing one feature from what I had before, more command line handling.

The thing you could do with mocp was type

mocp -f
mocp -G

And mocp would skip to the next song, or pause / unpause it.

It would be nice to have something like that in termusic, from the command line, such as :

termusic --next / -n
termusic --toggle-pause / -T

I also would be useful for WM users, as it allows to map keybindings to control the music player, as I could do with mocp.

BTW : termusic is awesome so far !

tramhao commented 1 year ago

Thanks for your great feedback. About the function, seems it need a separate daemon running, to accept the command from another thread. It'll need a server/client structure, thus it could take some time. But I'll keep it in the todo list. Currently, the function you requested can be achieved through mpris. I'll list what I'm doing right now:

  1. I'm running leftwm, a window manager written in rust. I use polybar, and I setup a widget with mpris player.
  2. In this widget, I can click to pause, double click to skip to next song etc.
  3. It's possible to configure hotkey for it I think, but I haven't tried.
Dazaisan99 commented 1 year ago

Thanks for the reply ! It works like a charm.

For those wondering how to use your WM like me to control it :

  1. Install MPRIS (see https://wiki.archlinux.org/title/MPRIS)
  2. Configure your WM accordingly, for example, BSPWM would be
alt + {Left, Right, Down}
    playerctl {previous, next, play-pause}

Thanks again !

tramhao commented 1 year ago

No big deal and thanks for the detail explanation.

VuiMuich commented 1 year ago

With 0.7.11 this should be possible now, right? I was thinking of giving a PR for this a shot, but probably won't have time for it in the next couple weeks. @tramhao do you already have plans on implementing this? If not I might look into it after summer.

hasezoey commented 8 months ago

from my understanding this could now be added quite easily, but there are some questions to answer first: