I showed you my source code, pls respond
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
2.7 KiB

  1. #+TITLE: EMMS
  2. #+AUTHOR: Christopher James Hayward
  3. #+EMAIL: chris@chrishayward.xyz
  4. #+PROPERTY: header-args:emacs-lisp :tangle emms.el :comments org
  5. #+PROPERTY: header-args :results silent :eval no-export :comments org
  6. #+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil
  7. #+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp: nil
  8. EMMS[fn:1] is Emacs as a multimedia player.
  9. * Setup
  10. Make sure you install the required packages on your system before loading the module.
  11. #+begin_src shell
  12. RUN apt install -y mpc mpd mpv
  13. #+end_src
  14. ** Music player daemon
  15. :PROPERTIES:
  16. :header-args: :tangle ../config/mpd.conf
  17. :END:
  18. MPD[fn:2] uses a simple text configuration file. Most options only accept a string in " quotes ". The most important option to configure is the ~music_directory~. This is where all of the music ~mpd~[fn:2] will serve exists. It will read the directory recursively.
  19. #+begin_src conf
  20. music_directory "~/.local/share/media/music"
  21. #+end_src
  22. You can configure where ~mpd~[fn:2] will look for playlists. You may want to configure this option if you share your playlists between devices.
  23. #+begin_src conf
  24. playlist_directory "~/.local/share/media/playlists"
  25. #+end_src
  26. It's possible to serve ~mpd~[fn:2] over the network by configuring it to listen on =0.0.0.0=, or by the systems host name. For a local setup, leave it as =localhost=.
  27. #+begin_src conf
  28. bind_to_address "localhost"
  29. port "6600"
  30. #+end_src
  31. *** Deploy the configuration
  32. MPD[fn:2] will look for its configuration in =~/.config/mpd/mpd.conf=, and =/etc/mpd.conf= respectively.
  33. #+begin_src emacs-lisp
  34. (let ((mpd-dir "~/.config/mpd"))
  35. (unless (file-exists-p mpd-dir)
  36. (make-directory mpd-dir t))
  37. (dotfiles/symlink "~/.emacs.d/config/mpd.conf"
  38. (concat mpd-dir "/mpd.conf")))
  39. #+end_src
  40. * Config
  41. Displays and play multimedia from within Emacs with ~emms~[fn:1], using a variety of external players from different sources. It can run as a minimalist player and controlled with commands, or a fully fledged interactive media browser. It can display album art, play streaming media, tag files, search lyrics, and provide ~mpd~[fn:2] connectivity.
  42. #+begin_src emacs-lisp
  43. (use-package emms
  44. :custom (emms-player-mpd-server-name "localhost")
  45. (emms-player-mpd-server-port "6600")
  46. :config (require 'emms-setup)
  47. (require 'emms-player-mpd)
  48. (emms-all)
  49. (emms-default-players)
  50. (add-to-list 'emms-info-functions 'emms-info-mpd)
  51. (add-to-list 'emms-player-list 'emms-player-mpd))
  52. #+end_src
  53. * Shortcuts
  54. Place bindings for ~emms~[fn:1] behind =SPC u=:
  55. #+begin_src emacs-lisp
  56. (dotfiles/leader
  57. "u" '(:ignore t :which-key "EMMS"))
  58. #+end_src
  59. * Footnotes
  60. [fn:1] https://gnu.org/software/emms/
  61. [fn:2] https://musicpd.org