From 3e96ae1ade23eee42b63ed047682b7cbf430f7d8 Mon Sep 17 00:00:00 2001 From: jao Date: Wed, 1 Oct 2025 17:23:20 +0100 Subject: jao-mpc tweaks (mainly notifications) --- lib/media/jao-mpc.el | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lib/media') 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*") @@ -256,6 +257,20 @@ (interactive) (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: ") -- cgit v1.2.3