spotify-player icon indicating copy to clipboard operation
spotify-player copied to clipboard

Daemonize device ?

Open midnightexigent opened this issue 2 years ago • 2 comments

Currently whenever we leave the TUI, music stops playing. It would be better if music kept playing in the background.

Is such a feature in the roadmap ?

midnightexigent avatar May 27 '22 14:05 midnightexigent

Actually after looking a bit further into this, I noticed that librespot itself is already a pretty feature-complete device/daemon. Is there any reason spotify-player needs to wrap librespot and be a device itself ? Can't it just be a tui client ?

midnightexigent avatar May 27 '22 18:05 midnightexigent

Currently whenever we leave the TUI, music stops playing. It would be better if music kept playing in the background.

So spotify-player is made to be a TUI alternative to official Spotify app. Similar to the Spotify app, if you start streaming music there, quit the app will stop playing the music.

Is such a feature in the roadmap ?

Not in a roadmap atm, but add a --daemon option should be trivial and it will become handy when media control support is implemented. Without that, there is no point of running the app as a daemon as the only thing you can do with it is play music, e.g cannot toggle play/pause, next, prev, etc.

aome510 avatar May 27 '22 19:05 aome510

As an alternative here: spotifyd already works as a spotify daemon, and by setting default_device I can automatically play from that. It would be nice if I could disable the spotify_player device entirely, since in such a setup I never want to play from it.

jesyspa avatar Mar 24 '23 14:03 jesyspa

It would be nice if I could disable the spotify_player device entirely, since in such a setup I never want to play from it.

You can disable the integrated client entirely by building the app without streaming feature (included as default features). One way to do it is:

cargo install spotify_player --no-default-features

aome510 avatar Mar 24 '23 14:03 aome510

Thanks, that's good to know. It would be a bit of a hassle to compile manually (I'm using the AUR package right now). If you're open to it, I could put together a patch that adds this as a configuration option? Or is there something that makes that difficult to implement?

jesyspa avatar Mar 24 '23 14:03 jesyspa

PRs are welcome! I never think about this, so I don't know if it would hard to implement.

That said, I still think using default_device should work as a config option in case you want to use another Spotify client.

aome510 avatar Mar 24 '23 14:03 aome510

Cool, I'll take a look this weekend! default_device does work, but I often have two or more spotify_players open (my workflow involves multiple X sessions on one machine), and the list gets quite long which makes it a hassle if I e.g. want to switch the audio to my phone. So it's a minor thing, really.

jesyspa avatar Mar 24 '23 14:03 jesyspa

default_device does work, but I often have two or more spotify_players open (my workflow involves multiple X sessions on one machine), and the list gets quite long which makes it a hassle if I e.g. want to switch the audio to my phone

Look forward to your PR! Just a note that there is SwitchDevice command that allows you to transfer the playback to another device in case u may miss it.

aome510 avatar Mar 24 '23 15:03 aome510

This feature could help spotify-player replace spotifyd. It seems extremely useful when combined with CLI commands.

With both features, spotify-player ould completely replace my spotifyd+spotify-tui workflow.

cheyngoodman avatar Apr 23 '23 18:04 cheyngoodman

@cheyngoodman in case u may miss, you don't need a "spotifyd+spotify-tui" kind of workflow with spotify-player as the app itself has an integrated Spotify client for streaming, so you don't need another client like spotifyd.

I think the daemon device is only good when you use with the CLI app to control the music without an UI. Is that what you means by your "spotifyd+spotify-tui" workflow?

aome510 avatar Apr 23 '23 18:04 aome510

Right, I wish to use the UI for browsing or managing playlists occasionally, but I'm mostly playing music without the interface.

I'm hoping to completely replace spotify-tui with spotify_player for controlling the music without a UI. Then, if possible with this daemon feature I can also replace spotifyd with spotify_player.

I'm getting close to my preferred workflow with spotifyd for playing without UI + playerctl for controlling + spotify_player for browsing. It's almost perfect but playerctl cannot like/unlike and struggles with volume.

I'm hoping spotify_player replace all the spotify related apps I use.

cheyngoodman avatar Apr 23 '23 19:04 cheyngoodman