Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Command line handling #101

Open
Dazaisan99 opened this issue Jan 3, 2023 · 6 comments
Open

[Feature request] Command line handling #101

Dazaisan99 opened this issue Jan 3, 2023 · 6 comments

Comments

@Dazaisan99
Copy link

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
Copy link
Owner

tramhao commented Jan 5, 2023

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
Copy link
Author

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
Copy link
Owner

tramhao commented Jan 6, 2023

No big deal and thanks for the detail explanation.

@VuiMuich
Copy link

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
Copy link
Contributor

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 the termusic-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 multiple commands / actions be allowed at once (bin --play --volume 50) (this would exclude the "subcommand" route, because clap is not able to handle that to my knowledge)

@hasezoey
Copy link
Contributor

Once #429 lands, this should be relatively easy to implement and populate to all clients, though the question still stands on how to implement this, see my last comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants