diff options
Diffstat (limited to '.config/emacs/modules/bd--emms.el')
-rw-r--r-- | .config/emacs/modules/bd--emms.el | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/.config/emacs/modules/bd--emms.el b/.config/emacs/modules/bd--emms.el new file mode 100644 index 0000000..40acf36 --- /dev/null +++ b/.config/emacs/modules/bd--emms.el @@ -0,0 +1,47 @@ +;; -*- lexical-binding: t; -*- + + +(defun emms-open-playlist-buffer () + "Opens the current playlist in the right +side window." + (interactive) + (if (get-buffer emms-playlist-buffer-name) + (progn (display-buffer-in-side-window (get-buffer emms-playlist-buffer-name) '((side . right))) + (select-window (get-buffer-window emms-playlist-buffer-name))) + (message "The Ainur cannot hear you..."))) + +(defun emms-quickstart () + "Queues a shuffled playlist and starts +playback." + (interactive) + (emms-stop) + (when (bufferp emms-playlist-buffer-name) + (kill-buffer emms-playlist-buffer-name)) + (emms-play-directory-tree (expand-file-name "~/Personal/mpd/music/")) + (emms-shuffle)) + +(use-package emms + :bind (("C-z C-m" . 'emms-open-playlist-buffer) + ("C-z C-p" . 'emms-play-playlist) + ("C-z C-s" . 'emms-quickstart)) + :config + (emms-all) + (add-to-list 'emms-info-functions 'emms-info-functions 'emms-info-mpd) + (add-to-list 'emms-player-list 'emms-player-mpd) + :custom + ;; make sure mpd is configured similarly + (emms-player-mpd-server-name "localhost") + (emms-player-mod-server-port "6600") + ;; set dir and volume keys + (emms-player-mpd-music-directory (expand-file-name "~/Personal/mpd/music/")) + (emms-source-file-default-directory (expand-file-name "~/Personal/mpd/playlists/")) + (emms-volume-change-function 'emms-volume-mpd-change) + ;; misc + (emms-mode-line-format "%s ") + (emms-playlist-buffer-name "*Playlist*") + (require 'all-the-icons) + (emms-mode-line-icon-before-format (format "%s" (all-the-icons-fileicon "owl"))) + (emms-mode-line-icon-enabled-p t)) + + +(provide 'bd--emms) |