Add bongo
This commit is contained in:
parent
c921132330
commit
88e218faf2
19
init.el
19
init.el
|
@ -700,6 +700,8 @@
|
||||||
tab-bar-format-align-right
|
tab-bar-format-align-right
|
||||||
;;+tab-bar-misc-info
|
;;+tab-bar-misc-info
|
||||||
tab-bar-separator
|
tab-bar-separator
|
||||||
|
+tab-bar-bongo
|
||||||
|
+tab-bar-emms
|
||||||
+tab-bar-tracking-mode
|
+tab-bar-tracking-mode
|
||||||
+tab-bar-date))
|
+tab-bar-date))
|
||||||
(tab-bar-mode +1)
|
(tab-bar-mode +1)
|
||||||
|
@ -1222,11 +1224,26 @@ See also `crux-reopen-as-root-mode'."
|
||||||
(:load-after consult embark)
|
(:load-after consult embark)
|
||||||
(add-hook 'embark-collect-mode-hook #'consult-preview-at-point-mode))
|
(add-hook 'embark-collect-mode-hook #'consult-preview-at-point-mode))
|
||||||
|
|
||||||
(setup (:straight emms)
|
(setup (:straight (emms
|
||||||
|
:type git
|
||||||
|
:flavor melpa
|
||||||
|
:files ("*.el"
|
||||||
|
"lisp/*.el"
|
||||||
|
"doc/emms.info"
|
||||||
|
"doc/emms.texinfo"
|
||||||
|
"emms-pkg.el")
|
||||||
|
:pre-build ("make" "-Cdoc")
|
||||||
|
:repo "https://git.savannah.gnu.org/git/emms.git"))
|
||||||
(:also-load +emms)
|
(:also-load +emms)
|
||||||
;; TODO: Definitely need to do more customization here
|
;; TODO: Definitely need to do more customization here
|
||||||
(:option emms-source-file-default-directory "~/var/music/"
|
(:option emms-source-file-default-directory "~/var/music/"
|
||||||
emms-player-mpv-update-metadata t)
|
emms-player-mpv-update-metadata t)
|
||||||
|
(dolist (hook '(emms-browser-mode-hook
|
||||||
|
emms-lyrics-mode-hook
|
||||||
|
emms-playlist-mode-hook
|
||||||
|
emms-tag-editor-mode-hook))
|
||||||
|
(add-hook hook #'turn-off-+key-mode)
|
||||||
|
(add-hook hook #'turn-off-user-save-mode))
|
||||||
(require 'emms-setup)
|
(require 'emms-setup)
|
||||||
(emms-all)
|
(emms-all)
|
||||||
(emms-default-players)
|
(emms-default-players)
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
;;; +bongo.el --- customizations in bongo -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
(defun +bongo-notify ()
|
||||||
|
(notifications-notify
|
||||||
|
:title "Now Playing"
|
||||||
|
:body (let ((bongo-field-separator "
|
||||||
|
"))
|
||||||
|
(substring-no-properties (bongo-formatted-infoset)))
|
||||||
|
:urgency 'low
|
||||||
|
:transient t))
|
||||||
|
|
||||||
|
(provide '+bongo)
|
||||||
|
;;; +bongo.el ends here
|
|
@ -48,6 +48,37 @@
|
||||||
ignore
|
ignore
|
||||||
:help (discord-date-string)))))
|
: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
|
(defvar +tab-bar-show-original nil
|
||||||
"Original value of `tab-bar-show'.")
|
"Original value of `tab-bar-show'.")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue