diff options
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/+bongo.el | 17 | ||||
-rw-r--r-- | lisp/+tab-bar.el | 31 |
2 files changed, 48 insertions, 0 deletions
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 | ||