[Feature request] CLI options for media control
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 !
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:
- I'm running leftwm, a window manager written in rust. I use polybar, and I setup a widget with mpris player.
- In this widget, I can click to pause, double click to skip to next song etc.
- It's possible to configure hotkey for it I think, but I haven't tried.
Thanks for the reply ! It works like a charm.
For those wondering how to use your WM like me to control it :
- Install MPRIS (see https://wiki.archlinux.org/title/MPRIS)
- Configure your WM accordingly, for example, BSPWM would be
alt + {Left, Right, Down}
playerctl {previous, next, play-pause}
Thanks again !
No big deal and thanks for the detail explanation.
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.
from my understanding this could now be added quite easily, but there are some questions to answer first:
- where to add this, the
termusic(-tui) binary or thetermusic-server(server) binary? - what style should the commands be
- should the commands be arguments (
bin --pause), or - should the command be subcommands (
bin pause)
- should the commands be arguments (
- should multiple commands / actions be allowed at once (
bin --play --volume 50) (this would exclude the "subcommand" route, becauseclapis not able to handle that to my knowledge)