Run ncspot in the background using tmux #1478
Jiogo18
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
ncspot user interface is nice, but sometimes we just want the music without terminal.
Here is a solution that allows you to use ncspot in the background.
tmux new -s ncspot -d ncspot
tmux attach -t ncspot
Ctrl+b, d
(the instance will still run in the background with tmux)tmux kill-session -t ncspot
Add the keybind
"q" = "exec tmux detach > /dev/null
to detach by pressingq
.Advantages
It is possible to attach to the same instance multiple time,
so you don't have to find which terminal you started ncspot with.
Start as a service
Create a service of Type=forking, set ExecStart and ExecStop with the above commands.
Smaller footprint
ncspot uses 38 MB in my case
But this measure is missing the terminal and the shell.
With a custom configuration:
The terminal takes 125-150 MB (shared with multiple shell)
The shell takes 44-50 MB
With a lighter terminal+shell:
xterm and bash use around 17 MB
With tmux/screen:
The screen+bash takes 6 MB,
When detached, no terminal+shell is required
When attached, add 4 MB to the terminal+shell measure
Not a huge deal in front of the incredible 35-46 MB of ncspot, but not negligible.
screen
The original post used
screen
, which doesn't work well for ncspot (click will freeze).If you prefer screen:
screen -dmS ncspot ncspot
screen -S ncspot -x
Ctrl+a, d
or withexec screen -d > /dev/null
for the keybindscreen -XS ncspot quit
Beta Was this translation helpful? Give feedback.
All reactions