Closed robertodr closed 2 years ago
ok, i found the problem, you can't put a space in an arg, so you must write "--format" and "{{playerName}}" in 2 separate args :
(defun playerctl-metadata ()
"Get metadata from playerctl player."
(interactive)
(let ((proc (start-process "playerctl.el" "*playerctl*" "playerctl" "metadata" "--format" "{{playerName}}")))
(set-process-filter proc (lambda
(proc line)
(message line))))
)
I am also a true newbee in elisp. But i learned something today with you 😃
Excellent. That was the only combination I had not tried, as I could not see any such suggestion in the documentation for start-process
!
Yea, the documentation is not good. So, you want push a new feature ?
I'd like to. I've expanded the metadata to query:
(defun playerctl-metadata ()
"Get metadata from playerctl player."
(interactive)
(let ((proc (start-process "playerctl.el" "*playerctl*" "playerctl" "metadata" "--format" "{{ playerName }}" "{{ lc(status) }}:" "{{ artist }}" "-" "{{ album }}" "-" "{{ title }}")))
(set-process-filter proc (lambda
(proc line)
(message line))))
)
and I only get the playerName
. Need to debug a bit more before submitting a PR.
cool !
Hello and thanks for this package! I am trying to add a new command to show metadata from a player:
The command
playerctl metadata --format {{ playerName }}
works fine in the terminal, but run within Emacs it gives:Unknown option --format {{ playerName }}
. This is the first time I write an Emacs function, should command-line arguments be treated in a special way?