All Projects → jorenvo → simple-mpc

jorenvo / simple-mpc

Licence: GPL-3.0 license
A GNU Emacs frontend to mpc.

Programming Languages

emacs lisp
2029 projects

Projects that are alternatives of or similar to simple-mpc

rofi-mpd
shell script for mpd that uses rofi to add songs, albums, playlist, jump to a song in the current playlist etc.
Stars: ✭ 19 (-50%)
Mutual labels:  mpd, mpc
Dotfiles
My vim, zsh, tmux, and macOS dotfiles
Stars: ✭ 209 (+450%)
Mutual labels:  mpd
Dotfiles
My dotfiles managed by GNU Stow - Arch, i3-gaps, bspwm, ncmpcpp, (neo)vim, zsh etc.
Stars: ✭ 99 (+160.53%)
Mutual labels:  mpd
Vimus
An MPD client with vim-like key bindings, written in Haskell
Stars: ✭ 129 (+239.47%)
Mutual labels:  mpd
Playerctl
🎧 mpris media player command-line controller for vlc, mpv, RhythmBox, web browsers, cmus, mpd, spotify and others.
Stars: ✭ 1,365 (+3492.11%)
Mutual labels:  mpd
Fzf Scripts
a collection of scripts that rely on https://github.com/junegunn/fzf
Stars: ✭ 158 (+315.79%)
Mutual labels:  mpd
Fmui
fzf mpd user interface
Stars: ✭ 93 (+144.74%)
Mutual labels:  mpd
conclave
Query compiler for secure multi-party computation.
Stars: ✭ 86 (+126.32%)
Mutual labels:  mpc
Boombeastic
A Raspberry Pi based smart connected speaker with support for airplay, spotify, mpd and local playback
Stars: ✭ 195 (+413.16%)
Mutual labels:  mpd
Deezer Downloader
Download music from Deezer with a nice front end
Stars: ✭ 127 (+234.21%)
Mutual labels:  mpd
Rompr
Web client for Mopidy and MPD
Stars: ✭ 115 (+202.63%)
Mutual labels:  mpd
My dotfiles
Just a collections of my dotfiles...
Stars: ✭ 101 (+165.79%)
Mutual labels:  mpd
Clerk
clerk - mpd client, based on rofi/fzf
Stars: ✭ 180 (+373.68%)
Mutual labels:  mpd
Dots
A Repository For Config Files / Dotfiles / Themes / Color Schemes / Etc...
Stars: ✭ 100 (+163.16%)
Mutual labels:  mpd
Kunst
Download and display album art or display embedded album art
Stars: ✭ 242 (+536.84%)
Mutual labels:  mpd
Malp
M.A.L.P. - Android MPD client
Stars: ✭ 94 (+147.37%)
Mutual labels:  mpd
Dotfiles
If there is a shell, there is a way!
Stars: ✭ 112 (+194.74%)
Mutual labels:  mpd
So Nice
Small Web interface to control iTunes, Spotify, Rdio, MPD, Rhythmbox, Amarok and XMMS2. ♫
Stars: ✭ 141 (+271.05%)
Mutual labels:  mpd
WeDPR-Lab-iOS-SDK
iOS SDK of WeDPR-Lab-Core; WeDPR即时可用场景式隐私保护高效解决方案核心算法组件iOS SDK
Stars: ✭ 13 (-65.79%)
Mutual labels:  mpc
mpc
Autonomous control of an USV using Model Predictive Control
Stars: ✭ 102 (+168.42%)
Mutual labels:  mpc

simple-mpc http://melpa.org/packages/simple-mpc-badge.svg

A GNU Emacs major mode that acts as a front end to mpc. ./screenshot.png

Requirements

Installation

MELPA

The easiest way to install is through MELPA.

To do this add MELPA to your package-archives list if you have not yet done so:

(require 'package) ;; You might already have this line
(add-to-list 'package-archives
             '("melpa" . "http://melpa.org/packages/"))
(package-initialize) ;; You might already have this line

Then install the package through either M-x list-packages or by just running M-x package-install simple-mpc.

Manual

  • Clone the repository
  • Add it to your emacs init:
(add-to-list 'load-path "path/to/simple-mpc")
(require 'simple-mpc)

Usage

Quickstart

Start with M-x simple-mpc. The rest of the keybindings now appear in a buffer. Configuration can be done with M-x customize-group <RET> simple-mpc. Viewing the current playlist and querying the database is done with c and s respectively. Most commands (like simple-mpc-query-add and simple-mpc-delete) respect the region.

Structure

Simple-mpc consists of three ‘views’, two of which have their own minor mode that implements specific extra functionality:

viewmajor modeminor mode
mainsimple-mpc-mode/
querysimple-mpc-modesimple-mpc-query-mode
current playlistsimple-mpc-modesimple-mpc-current-playlist-mode

simple-mpc-mode is always active and contains the most common bindings. Additional functionality is added with minor modes. Someone who does not like the interface can use simple-mpc-query-mode and simple-mpc-current-playlist-mode directly.

Bindings

Bindings can be viewed with describe-mode (C-h m) but are listed below for completeness:

simple-mpc-mode

keyfunction
tsimple-mpc-toggle
nsimple-mpc-next
psimple-mpc-prev
fsimple-mpc-seek-forward
bsimple-mpc-seek-backward
csimple-mpc-view-current-playlist
Csimple-mpc-clear-current-playlist
Ssimple-mpc-shuffle-current-playlist
lsimple-mpc-load-playlist
ssimple-mpc-query
qsimple-mpc-quit

simple-mpc-query-mode

keyfunction
qsimple-mpc-query-quit
Ssimple-mpc-query-sort
<return>simple-mpc-query-add
<S-return>simple-mpc-query-add-and-play

simple-mpc-current-playlist-mode

keyfunction
dsimple-mpc-delete
qsimple-mpc-current-playlist-quit
<return>simple-mpc-play-current-line

Hook

You can use a hook like this to ensure that mpd is running when you open simple-mpc:

(add-hook 'simple-mpc-mode-hook (lambda () (my/mpd-start)))

(defun my/mpd-start ()
  "Start MPD if it's not already running and check, then update the MPD database."
  (interactive)
  (if (= 0 (call-process "sh" nil nil nil "-c" "pgrep mpd"))
      (message "MPD was already running.")
    (shell-command "mpd")
    (my/mpd-update)
    (message "MPD started.")))

(defun my/mpd-kill ()
  "Kill MPD."
  (interactive)
  (call-process "killall" nil nil nil "mpd")
  (message "MPD killed."))

(defun my/mpd-update ()
  "Updates the MPD database synchronously."
  (interactive)
  (call-process "mpc" nil nil nil "update")
  (message "MPD database updated."))

Configuration

Configuring simple-mpc can be done entirely through the simple-mpc customization group (M-x customize-group simple-mpc<RET>).

When using Mopidy as a server setting simple-mpc-playlist-format is recommended, the default output from mpc search won’t be very descriptive otherwise. The following configuration works well mopidy (note that the whitespace between the metadata delimiters and the separator itself are TAB characters (C-q <TAB>), not spaces):

(custom-set-variables
...
 '(simple-mpc-playlist-format "%artist%	%album%	%title%	%file%")
 '(simple-mpc-table-separator "	")
...)

History

This mode was inspired by mingus written by Niels Giesen and parts of the interface were inspired by mu4e written by Dirk-Jan C. Binnema. I used mingus for > 4 years and was mostly happy with it, but occasionally there were bugs and interface choices that I disagreed with. After looking through the source code in an attempt to fix these issues I came to the conclusion that it would be better to implement my own mode. A big reason for this decision was the fact that mingus uses its own MPD library implementation called libmpdee.el, which I expect contain some obscure bugs. I think it is a better choice to instead take advantage of mpc, a small program that is maintained by MPD developers and implements more than libmpdee.el. On top of that it makes the major mode much smaller and easier to maintain. Currently simple-mpc consists of ~300 LOC versus ~5000 LOC for mingus (mingus does have more features though).

GNU Emacs also contains mpc.el written by Stefan Monnier. It’s interesting but wasn’t really what I was looking for, partly because of its interface (inspired by Rhythmbox), and partly because it’s not particularly well documented.

Todo

  • add a way to combine multiple search terms e.g. mpc search artist a album b
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].