2

I can't find a way to copy a title of currently played song in ncmpcpp to clipboard.

Is there any shortcut to do this ?

Ubuntu Version: 19.10:

$ lsb_release -r
Release:    19.10

ncmpcpp 0.8.2:

$ ncmpcpp -v
ncmpcpp 0.8.2

optional screens compiled-in:
 - tag editor
 - tiny tag editor
 - outputs
 - visualizer
 - clock

encoding detection: enabled
built with support for: fftw ncurses taglib
  • 2
    Please click [edit] and revise your question to specify the version and release number of Ubuntu in use. Also see http://manpages.ubuntu.com/manpages/bionic/man1/ncmpcpp.1.html and https://pkgbuild.com/~jelle/ncmpcpp/ – K7AAY Dec 18 '19 at 17:25
  • @K7AAY Added. Thank You I think I have found it. ncmpcpp --current-song Reading configuration from /home/mp/.ncmpcpp/config... (-:--) Juan Erbin - Nube Music Sessions 016 (18 December 2019) ! – Michal Przybylowicz Dec 18 '19 at 18:56

1 Answers1

2

Thanks to @K7AAY I have found an answer:

#!/bin/bash

SONG=`ncmpcpp --current-song -q`
echo "NAME: ${SONG}"
echo -n $SONG | xclip -selection c

Running above script will print song name and copy it to the clipboard.

$ ./get-current-song.sh 
NAME: (-:--) Daniel Gomez - Two Ways [New York] 055 (18 December 2019) Hour 1