From b9a48e5268e1df5e5952e5a3a7588cdccb03c782 Mon Sep 17 00:00:00 2001 From: jao Date: Tue, 18 Jan 2022 23:28:17 +0000 Subject: jao-spt (wee) improvements --- lib/media/jao-spt.el | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'lib/media/jao-spt.el') diff --git a/lib/media/jao-spt.el b/lib/media/jao-spt.el index adafed6..b8ef0f0 100644 --- a/lib/media/jao-spt.el +++ b/lib/media/jao-spt.el @@ -28,6 +28,7 @@ (require 'jao-notify) (defvar jao-spt-bin (expand-file-name "~/bin/spt")) +(defvar jao-spt-format "'%s %t - %a [%r] %f'") (defun jao-spt--exec (&rest args) (let ((display-buffer-alist `((".*spt commands.*" display-buffer-no-window))) @@ -43,7 +44,9 @@ ;;;###autoload (defun jao-spt-update-status () (interactive) - (let ((st (string-trim (shell-command-to-string (format "%s pb" jao-spt-bin))))) + (let ((st (string-trim (shell-command-to-string (format "%s pb -f %s" + jao-spt-bin + jao-spt-format))))) (setq jao-spt--status-str (when (string-prefix-p "▶" st) st)) (jao-minibuffer-refresh) st)) @@ -69,9 +72,14 @@ (let ((jao-notify-use-messages-p t)) (jao-notify (jao-spt-update-status)))) +;;;###autoload +(defun jao-spt-toggle-shuffle () + (interactive) + (jao-spt--exec "pb" "--shuffle")) + ;;;###autoload (defun jao-spt-set-up () - (jao-minibuffer-add-variable 'jao-spt--status-str 20)) + (jao-minibuffer-add-msg-variable 'jao-spt--status-str)) (provide 'jao-spt) ;;; jao-spt.el ends here -- cgit v1.2.3