diff --git a/modules/app/emms/README.org b/modules/app/emms/README.org new file mode 100644 index 000000000..6741690d7 --- /dev/null +++ b/modules/app/emms/README.org @@ -0,0 +1,71 @@ +#+TITLE: app/emms +#+DATE: March 6, 2021 +#+SINCE: v3.0.0 +#+STARTUP: inlineimages nofold + +* Table of Contents :TOC_3:noexport: +- [[#description][Description]] + - [[#maintainers][Maintainers]] + - [[#module-flags][Module Flags]] + - [[#plugins][Plugins]] +- [[#prerequisites][Prerequisites]] + - [[#arch-linux][Arch Linux]] + - [[#nixos][NixOS]] + - [[#ubuntu][Ubuntu]] +- [[#troubleshooting][Troubleshooting]] + - [[#new-music-files-not-showing-up-in-database][New music files not showing up in database]] +- [[#appendix][Appendix]] + - [[#keybinds][Keybinds]] + +* Description +This module enables Emacs to be used as a music player. It uses [[https://www.musicpd.org/][mpd]] as a backend +server and [[https://musicpd.org/clients/mpc/][mpc]] to update your music database. + +** Maintainers +This module has no dedicated maintainers. + +** Module Flags +This module provides no flags. + +** Plugins ++ [[https://git.savannah.gnu.org/git/emms.git/][emms]] + +* Prerequisites +This module requires an active MPD server, the MPC utility, and a music library. + +** Arch Linux +#+BEGIN_SRC bash +pacman -S mpd mpc +#+END_SRC + +** NixOS +#+BEGIN_SRC nix +services.mpd.enable = true; +environment.systemPackages = [ pkgs.mpc_cli ]; +#+END_SRC + +** Ubuntu +#+BEGIN_SRC bash +apt install mpd mpc +#+END_SRC + +* Troubleshooting +** New music files not showing up in database +Try =M-x +emms/mpd-restart-music-daemon=. If that doesn't work restart emacs. + +* Appendix +** Keybinds ++ =SPC m l= Toggles whether or not the player repeats the playlist. ++ =SPC m m= Mixes the playlist. ++ =SPC m i= Insert specific song ++ =SPC m s= Save the current playlist to a file ++ =SPC m p= Insert playlist save into current playlist ++ =g a= Sort the browser by artists ++ =g b= Sort the browser by genre ++ =X= Stops the player ++ =x= pauses the player ++ =D= in the playlist window removes that item ++ =C= clears the playlist ++ =>= move five seconds forward in the current track ++ =<= Opposite five back ++ =RET= In browser adds the artist's songs to the playlist, in the playlist starts playlist. diff --git a/modules/app/emms/autoload.el b/modules/app/emms/autoload.el new file mode 100644 index 000000000..f08aa787c --- /dev/null +++ b/modules/app/emms/autoload.el @@ -0,0 +1,30 @@ +;;; app/emms/autoload.el -*- lexical-binding: t; -*- + +;;;###autoload +(defun +emms/mpd-start-music-daemon () + (interactive) + (start-process "mpd" nil "mpd") + (+emms/mpc-update-database) + (emms-player-mpd-connect) + (emms-cache-set-from-mpd-all) + (message "MPD Started!")) + +;;;###autoload +(defun +emms/mpd-kill-music-daemon () + (interactive) + (emms-stop) + (call-process "mpd" nil nil nil "--kill") + (message "MPD Killed!")) + +;;;###autoload +(defun +emms/mpc-update-database () + (interactive) + (call-process "mpc" nil nil nil "update") + (message "MPD Database Updated!")) + +;;;###autoload +(defun +emms/mpd-restart-music-daemon () + (interactive) + (+emms/mpd-kill-music-daemon) + (+emms/mpd-start-music-daemon) + (message "MPD Restarted!")) diff --git a/modules/app/emms/config.el b/modules/app/emms/config.el new file mode 100644 index 000000000..d78be2098 --- /dev/null +++ b/modules/app/emms/config.el @@ -0,0 +1,18 @@ +;;; app/emms/config.el -*- lexical-binding: t; -*- + +(use-package! emms + :defer t + :init + (setq emms-directory (concat doom-etc-dir "emms") + emms-cache-file (concat doom-cache-dir "emms")) + :config + (emms-all) + (emms-default-players) + (map! :map emms-playlist-mode-map + :localleader + "l" #'emms-toggle-repeat-playlist + "p" #'emms-insert-playlist + "i" #'emms-insert-file + "t" #'emms-toggle-repeat-track + "s" #'emms-playlist-save + "m" #'emms-shuffle)) diff --git a/modules/app/emms/packages.el b/modules/app/emms/packages.el new file mode 100644 index 000000000..2d215419e --- /dev/null +++ b/modules/app/emms/packages.el @@ -0,0 +1,4 @@ +;; -*- no-byte-compile: t; -*- +;;; app/emms/packages.el + +(package! emms :pin "60c6172fb0ec78fc70cf8329e9be5842c041107b")