summaryrefslogtreecommitdiffhomepage
path: root/attic
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-05-31 05:21:13 +0100
committerjao <jao@gnu.org>2021-05-31 06:22:47 +0100
commit7ddfda9b0af623d5039f7073f6c043f370c129cc (patch)
tree74828b5d5c1353110852d97908f853f8979c8891 /attic
parentd5fa86062b31179c268cb914266f0e646a244229 (diff)
downloadelibs-7ddfda9b0af623d5039f7073f6c043f370c129cc.tar.gz
elibs-7ddfda9b0af623d5039f7073f6c043f370c129cc.tar.bz2
jao-mpc: more fat trimming: mpdel to the attic
Diffstat (limited to 'attic')
-rw-r--r--attic/misc.org75
1 files changed, 75 insertions, 0 deletions
diff --git a/attic/misc.org b/attic/misc.org
index 23336e0..7087111 100644
--- a/attic/misc.org
+++ b/attic/misc.org
@@ -1,5 +1,80 @@
#+title: Miscellaneous config bits that i don't use anymore
+* mpdel
+ #+BEGIN_SRC emacs-lisp
+ (jao-load-path "libmpdel")
+ (jao-load-path "mpdel")
+ (jao-load-path "navigel")
+
+ (use-package navigel
+ :init (setq navigel-display-messages nil))
+
+ (defun jao-mpdel-dup-dir-p (dir)
+ (and (libmpdel-directory-p dir)
+ (string-match-p "\\[.+\\]\\b"
+ (or (libmpdel--directory-path dir) ""))))
+
+ (defun jao-mpdel--filter (dirs)
+ (cl-remove-if 'jao-mpdel-dup-dir-p dirs))
+
+ (use-package libmpdel
+ :init (setq libmpdel-port 6669))
+
+ (use-package mpdel
+ :diminish
+ :init
+ (setq mpdel-browser-list-clean-up-function 'identity
+ mpdel-browser-top-level-entries
+ '(directories
+ empty-line
+ stored-playlists current-playlist
+ empty-line
+ "Spotify/Top Lists/Top artists/Personal"
+ "Spotify/Playlists/Featured"
+ empty-line
+ search-album search-artist search-title))
+
+ (defun jao-mpdel--show-osd (data song ml)
+ (let* ((no (1+ (string-to-number (or (cdr (assq 'song data)) "0"))))
+ (to (or (cdr (assq 'playlistlength data)) "0"))
+ (album (or (libmpdel-album-name song) ""))
+ (artist (or (libmpdel-artist-name song) ""))
+ (tms (split-string (or (cdr (assq 'time data)) "0/0") ":"))
+ (tm (format "%s/%s"
+ (libmpdel-time-to-string (car tms))
+ (libmpdel-time-to-string (cadr tms))))
+ (title (format "%s %s/%s. %s" tm no to
+ (or (libmpdel-entity-name song) ""))))
+ (if ml
+ (message "%s %s - %s (%s)" tm title artist album)
+ (jao-notify (format "%s (%s)" artist album)
+ title
+ jao-notify-audio-icon))))
+
+ (defun jao-mpdel-show-osd (&optional ml)
+ (interactive "P")
+ (let ((song (libmpdel-current-song)))
+ (when song
+ (libmpdel-send-command "status"
+ `(lambda (data)
+ (jao-mpdel--show-osd data ,song ,ml))))))
+
+ (defun jao-mpdel-search (&optional type)
+ (interactive
+ (list (completing-read "Search by: " '("album" "artist" "title"))))
+ (let* ((func (cond ((string= type "album") 'mpdel-core-search-by-album)
+ ((string= type "artist") 'mpdel-core-search-by-artist)
+ ((string= type "title") 'mpdel-core-search-by-title)))
+ (thing (read-from-minibuffer (format "Search for %s: " type))))
+ (mpdel-core-open (libmpdel-search-criteria-create :type type :what thing)))))
+
+ (use-package mpdel-browser)
+ (defalias 'mpdel-pop-to-browser 'mpdel-browser-open)
+
+ (mpdel-mode)
+ (define-key mpdel-browser-mode-map (kbd "n") #'next-line)
+ (define-key mpdel-browser-mode-map (kbd "p") #'previous-line)
+ #+END_SRC
* emms
*** configuration
#+BEGIN_SRC emacs-lisp