diff options
author | jao <jao@gnu.org> | 2022-01-18 23:28:17 +0000 |
---|---|---|
committer | jao <jao@gnu.org> | 2022-01-18 23:28:17 +0000 |
commit | b9a48e5268e1df5e5952e5a3a7588cdccb03c782 (patch) | |
tree | 1d7e94e8128eef7f0694364df9791f86388407fd /lib | |
parent | 425bdb7d43de9224b24e1adc1687adcf19a023c8 (diff) | |
download | elibs-b9a48e5268e1df5e5952e5a3a7588cdccb03c782.tar.gz elibs-b9a48e5268e1df5e5952e5a3a7588cdccb03c782.tar.bz2 |
jao-spt (wee) improvements
Diffstat (limited to 'lib')
-rw-r--r-- | lib/media/jao-spt.el | 12 |
1 files changed, 10 insertions, 2 deletions
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)) @@ -70,8 +73,13 @@ (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 |