Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EMMS Support #65

Open
WiredLovelace opened this issue Mar 4, 2022 · 2 comments
Open

EMMS Support #65

WiredLovelace opened this issue Mar 4, 2022 · 2 comments

Comments

@WiredLovelace
Copy link

Well, this might seem like a very silly feature but, it would be pretty amazing to display what EMMS is currently playing. I don't know how the Discord rich application integration system works but, would it be possible to print the value of another variable as well? like... A string we define

@Mstrodl
Copy link
Owner

Mstrodl commented Mar 5, 2022

Well, this might seem like a very silly feature but, it would be pretty amazing to display what EMMS is currently playing. I don't know how the Discord rich application integration system works but, would it be possible to print the value of another variable as well? like... A string we define

You can override elcord-buffer-details-format or PR a change to elcord--details-and-state which breaks out the state parameter into it's own function if you want:

;; Override this in your own config
(defun elcord-buffer-details-format ()
  "Return the buffer details string shown on discord."
  (format "Editing %s" (buffer-name)))

;; OR:
(defun elcord--details-and-state ()
  "Obtain the details and state to use for Discord's Rich Presence."
  (let ((activity (if elcord-display-buffer-details
                      (list
                       (cons "details" (funcall elcord-buffer-details-format-function))
                       ;; Replace this expression with a function call (`elcord-buffer-state-format-function`?)
                       (cons "state" (format "Line %s (%s of %S)"
                                             (format-mode-line "%l")
                                             (format-mode-line "%l")
                                             (+ 1 (count-lines (point-min) (point-max))))))
                    (list
                     (cons "details" "Editing")
                     (cons "state" (elcord--mode-text))))))
    (when elcord-display-elapsed
      (push (list "timestamps" (cons "start" elcord--startup-time)) activity))
    activity))

@zackattackz
Copy link
Contributor

Don't know if you're still interested but I'm almost finished with an auxiliary package that will add this functionality. It will display the song name, artist name, time remaining, and display album art picture :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants