about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--init.el19
-rw-r--r--lisp/+bongo.el17
-rw-r--r--lisp/+tab-bar.el31
3 files changed, 66 insertions, 1 deletions
diff --git a/init.el b/init.el index b204e8e..4b4d668 100644 --- a/init.el +++ b/init.el
@@ -700,6 +700,8 @@
700 tab-bar-format-align-right 700 tab-bar-format-align-right
701 ;;+tab-bar-misc-info 701 ;;+tab-bar-misc-info
702 tab-bar-separator 702 tab-bar-separator
703 +tab-bar-bongo
704 +tab-bar-emms
703 +tab-bar-tracking-mode 705 +tab-bar-tracking-mode
704 +tab-bar-date)) 706 +tab-bar-date))
705 (tab-bar-mode +1) 707 (tab-bar-mode +1)
@@ -1222,11 +1224,26 @@ See also `crux-reopen-as-root-mode'."
1222 (:load-after consult embark) 1224 (:load-after consult embark)
1223 (add-hook 'embark-collect-mode-hook #'consult-preview-at-point-mode)) 1225 (add-hook 'embark-collect-mode-hook #'consult-preview-at-point-mode))
1224 1226
1225(setup (:straight emms) 1227(setup (:straight (emms
1228 :type git
1229 :flavor melpa
1230 :files ("*.el"
1231 "lisp/*.el"
1232 "doc/emms.info"
1233 "doc/emms.texinfo"
1234 "emms-pkg.el")
1235 :pre-build ("make" "-Cdoc")
1236 :repo "https://git.savannah.gnu.org/git/emms.git"))
1226 (:also-load +emms) 1237 (:also-load +emms)
1227 ;; TODO: Definitely need to do more customization here 1238 ;; TODO: Definitely need to do more customization here
1228 (:option emms-source-file-default-directory "~/var/music/" 1239 (:option emms-source-file-default-directory "~/var/music/"
1229 emms-player-mpv-update-metadata t) 1240 emms-player-mpv-update-metadata t)
1241 (dolist (hook '(emms-browser-mode-hook
1242 emms-lyrics-mode-hook
1243 emms-playlist-mode-hook
1244 emms-tag-editor-mode-hook))
1245 (add-hook hook #'turn-off-+key-mode)
1246 (add-hook hook #'turn-off-user-save-mode))
1230 (require 'emms-setup) 1247 (require 'emms-setup)
1231 (emms-all) 1248 (emms-all)
1232 (emms-default-players) 1249 (emms-default-players)
diff --git a/lisp/+bongo.el b/lisp/+bongo.el new file mode 100644 index 0000000..d1a2ef4 --- /dev/null +++ b/lisp/+bongo.el
@@ -0,0 +1,17 @@
1;;; +bongo.el --- customizations in bongo -*- lexical-binding: t; -*-
2
3;;; Commentary:
4
5;;; Code:
6
7(defun +bongo-notify ()
8 (notifications-notify
9 :title "Now Playing"
10 :body (let ((bongo-field-separator "
11"))
12 (substring-no-properties (bongo-formatted-infoset)))
13 :urgency 'low
14 :transient t))
15
16(provide '+bongo)
17;;; +bongo.el ends here
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 @@
48 ignore 48 ignore
49 :help (discord-date-string))))) 49 :help (discord-date-string)))))
50 50
51(defcustom +tab-bar-emms-max-length 24
52 "Maximum length of `+tab-bar-emms'."
53 :type 'number)
54
55(defun +tab-bar-emms ()
56 "Display EMMS now playing information."
57 (when (and emms-mode-line-mode
58 emms-player-playing-p)
59 (let ((now-playing (+string-truncate (emms-mode-line-playlist-current)
60 (- +tab-bar-emms-max-length 2))))
61 `((emms-now-playing menu-item
62 ,(concat "{" now-playing "}" " ")
63 emms-pause
64 :help ,(emms-mode-line-playlist-current))))))
65
66(defun +tab-bar-bongo ()
67 "Display Bongo now playing information."
68 (when (and bongo-mode-line-indicator-mode
69 (bongo-playing-p))
70 `((bongo-now-playing menu-item
71 ,(concat "{"
72 (let ((bongo-field-separator ""))
73 (+string-truncate (replace-regexp-in-string
74 "\\(.*\\)\\(.*\\)\\(.*\\)"
75 "\\1: \\3"
76 (bongo-formatted-infoset))
77 (- +tab-bar-emms-max-length 2)))
78 "}")
79 bongo-pause/resume
80 :help ,(funcall bongo-header-line-function)))))
81
51(defvar +tab-bar-show-original nil 82(defvar +tab-bar-show-original nil
52 "Original value of `tab-bar-show'.") 83 "Original value of `tab-bar-show'.")
53 84