Skip to content
This repository was archived by the owner on Nov 13, 2023. It is now read-only.

ritschmaster/spacemacs-music-layer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

music layer

img/emms.jpg

Table of Contents

Description

This layer installs EMMS and configures it to use MPD. The only dependency of this layer is a running instance of MPD on your system. You can setup MPD with the following script:

$ mkdir -p ~/.config/mpd
$ cd ~/.config/mpd
$ touch database log pid state sticker sql

After that you create the file ~/.config/mpd/mpd.conf with the following content (this is an working example if you have pulse audio installed):

# Required files
db_file            "~/.config/mpd/database"
log_file           "~/.config/mpd/log"

# Optional
music_directory    "~/Music"
playlist_directory "~/Playlists" # "~/.config/mpd/playlists"
pid_file           "~/.config/mpd/pid"
state_file         "~/.config/mpd/state"
sticker_file       "~/.config/mpd/sticker.sql"

port "12010"

audio_output {
        type            "pulse"
        name            "pulse audio"
}

If you want to run MPD as SystemD user level application you can create the file ~/.config/systemd/user/mpd.service with the following content:

[Unit]
Description=Music Player Daemon (MPD)

[Service]
Type=forking
ExecStart=/usr/bin/mpd
ExecStop=/usr/bin/mpd --kill
Restart=always

[Install]
WantedBy=default.target

Now you can run:

$ systemctl start --user mpd
$ systemctl enable --user mpd

Install

To use this configuration layer, add it to your ~/.spacemacs. You will need to add music to the existing dotspacemacs-configuration-layers list in this file.

Further you have to give the port of the running MPD instance and connect emacs to it. You can achieve his by adding the following code to existing dotspacemacs/user-config function in your ~/.spacemacs file:

(setq emms-player-mpd-server-port "12010") ;; example port
(emms-player-mpd-connect)

Key bindings

Key BindingDescription
<SPC> a m oOpens the EMMS buffer
<SPC> a m SStarts the player
<SPC> a m sStops the player
<SPC> a m PPauses/continues the player
<SPC> a m pPrevious song
<SPC> a m nNext song
<SPC> a m +Raise the volume by 5%
<SPC> a m -Lower the volume by 5%
<SPC> a m *Raise the volume by 10%
<SPC> a m _Lower the volume by 10%
<SPC> a m lAdd playlist file
<SPC> a m fAdd a single file
<SPC> a m FSearch and add files
<SPC> a m <Seek backward
<SPC> a m >Seek forward
<SPC> a m hShuffle the playlist buffer
<SPC> a m cClear the playlist buffer

About

A music layer for spacemacs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published