From 88e218faf2d52a21001eea8491aecd12c54b074a Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 7 Feb 2022 13:16:00 -0600 Subject: Add bongo --- lisp/+tab-bar.el | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'lisp/+tab-bar.el') diff --git a/lisp/+tab-bar.el b/lisp/+tab-bar.el index 83870e9..6567f67 100644 --- a/lisp/+tab-bar.el +++ b/lisp/+tab-bar.el @@ -48,6 +48,37 @@ ignore :help (discord-date-string))))) +(defcustom +tab-bar-emms-max-length 24 + "Maximum length of `+tab-bar-emms'." + :type 'number) + +(defun +tab-bar-emms () + "Display EMMS now playing information." + (when (and emms-mode-line-mode + emms-player-playing-p) + (let ((now-playing (+string-truncate (emms-mode-line-playlist-current) + (- +tab-bar-emms-max-length 2)))) + `((emms-now-playing menu-item + ,(concat "{" now-playing "}" " ") + emms-pause + :help ,(emms-mode-line-playlist-current)))))) + +(defun +tab-bar-bongo () + "Display Bongo now playing information." + (when (and bongo-mode-line-indicator-mode + (bongo-playing-p)) + `((bongo-now-playing menu-item + ,(concat "{" + (let ((bongo-field-separator "")) + (+string-truncate (replace-regexp-in-string + "\\(.*\\)\\(.*\\)\\(.*\\)" + "\\1: \\3" + (bongo-formatted-infoset)) + (- +tab-bar-emms-max-length 2))) + "}") + bongo-pause/resume + :help ,(funcall bongo-header-line-function))))) + (defvar +tab-bar-show-original nil "Original value of `tab-bar-show'.") -- cgit 1.4.1-21-gabe81