hrkfdn / ncspot

Cross-platform ncurses Spotify client written in Rust, inspired by ncmpc and the likes.
BSD 2-Clause "Simplified" License
4.93k stars 206 forks source link

Ability to run shell commands #673

Closed dan-forsberg closed 2 years ago

dan-forsberg commented 2 years ago

Is your feature request related to a problem? Please describe. I'm currently running ncspot in a screen to be able to close the terminal that it's running in without stopping the music. This is a setup I've used with cmus before and in cmus I was able to bind the q key to run a shell command. In my case to detach from the screen to drop down into a terminal.

However I'm not able to do this with ncspot because I cannot bind a key to run a shell command.

Describe the solution you'd like An ability to run shell commands and the ability to bind a key to run that command, just like for example :pause can be bound to a key.

Describe alternatives you've considered Another possible solution, which I've seen been requested in issue #284 is to add a background/daemon-mode but understadably it's not a small feature to develop.

Bettehem commented 2 years ago

Could you bind a key to a playerctl command? ncspot can be controlled via MPRIS and playerctl let's you do that quite easily.

dan-forsberg commented 2 years ago

I have that sorted out already through my DE, so the media keys on my keyboard can play/pause, play the next song etc. But I'd like to be able to open a terminal, run spotify (or another alias which would attach to the screen with ncspot), change playlists, hit q (which would run screen -D [screen name]) and be dropped back to my shell without actually closing ncspot.

Right now I can /sort of/ do that, but I have to open another shell/terminal to detach the ncspot-screen or I have to close the terminal window.

Other than that I'm really liking the project :+1:

hrkfdn commented 2 years ago

Sounds like a reasonable feature, will look into it when I have the time :)