clangen / musikcube

a cross-platform, terminal-based music player, audio engine, metadata indexer, and server in c++
https://musikcube.com
BSD 3-Clause "New" or "Revised" License
4.16k stars 294 forks source link

CLI start/stop/pause calls? #615

Open stratacast opened 1 year ago

stratacast commented 1 year ago

Really happy to see the 3.0 release. Using it today, I remembered why I put it on the shelf. There's no way for me to toggle pause/play except to go to the command line window and pause. This is pretty inconvenient.

With something like Music On Console, you can call mocp --toggle-pause to play/pause and mocp --stop to stop playback. It would be really cool if musikcube would honor XF86AudioPlay keystrokes or have a command line argument that could be parsed that could be mapped to XF86AudioPlay or some other keyboard shortcut outside of the terminal

237dmitry commented 1 year ago

As a workaround you can use playerctl or kill to play-pause musikcube:

playerctl --help
man kill

playerctl play-pause

kill -s 19 musikcube     # pause
kill -s 18 musikcube     # play again
stratacast commented 1 year ago

playerctl doesn't seem to work. It doesn't appear to be an mpris player. Those kill signals look to be Linux only too.

237dmitry commented 1 year ago

playerctl doesn't seem to work.

Works... (on ArcoLinux in my case). Musikcube is the static build from release page.

Those kill signals look to be Linux only too.

On windows you can download pssuspend64.exe from Sysinternals suite. I symlinked it in $env:PATH as pssuspend.exe

pssuspend musikcube-cmd        # pause
pssuspend musikcube-cmd -r     # play

I agreed with your issue. This is just a workaround. The CLI is wanted.

stratacast commented 1 year ago

I don't run Windows either. It would be nice to have a broadly generic option built into the player itself vs rely on various third party tooling. But I appreciate you checking these options out for me. I guess I'll do what I did before and keep using Music on Console. Makes me wish I was able to contribute code to make this feature work, overall I prefer Musikcube

Dakedres commented 11 months ago

playerctl doesn't work with musikcube for me either. I'm using 3.0.0 on Void Linux.