diff options
author | jao <jao@gnu.org> | 2025-10-01 17:23:20 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2025-10-01 17:23:50 +0100 |
commit | 3e96ae1ade23eee42b63ed047682b7cbf430f7d8 (patch) | |
tree | 886508504f2d17f9f717557b1e23fce5135dae3b /lib/media/jao-mpc.el | |
parent | 1a54f3532dcd812b5b4c1c1ecfcf366d9aa10669 (diff) | |
download | elibs-3e96ae1ade23eee42b63ed047682b7cbf430f7d8.tar.gz elibs-3e96ae1ade23eee42b63ed047682b7cbf430f7d8.tar.bz2 |
jao-mpc tweaks (mainly notifications)
Diffstat (limited to 'lib/media/jao-mpc.el')
-rw-r--r-- | lib/media/jao-mpc.el | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/media/jao-mpc.el b/lib/media/jao-mpc.el index 82c38ba..2dfec76 100644 --- a/lib/media/jao-mpc.el +++ b/lib/media/jao-mpc.el @@ -30,6 +30,7 @@ (require 'jao-themes) (require 'jao-lyrics) (require 'jao-random-album) +(require 'jao-notify) (defconst jao-mpc--albums "*MPC Albums*") (defconst jao-mpc--playlist "*MPC Playlist*") @@ -257,6 +258,20 @@ (message "Playing time: %s" (jao-mpc--current-timestr t))) ;;;###autoload +(defun jao-mpc-notify (&optional port) + (interactive) + (when-let* ((current (jao-mpc--current))) + (let* ((artist (alist-get 'artist current)) + (title (alist-get 'title current)) + (album (alist-get 'album current)) + (track (alist-get 'track current)) + (times (jao-mpc--current-timestr t current))) + (jao-notify (format "%s -- %s" artist times) + (format "%s %s" track title) + jao-notify-audio-icon + album)))) + +;;;###autoload (defun jao-mpc-add-url (url) (interactive "sURL: ") (jao-mpc--cmd (format "add %s" url))) |