This code allows to have some commands to control MOC (Music on console; https://moc.daper.net) with Emacs
Afer you clone this repository (or save moc-player.el
),
git clone https://www.notabug.org/broncodev/moc-player
just
(add-to-list 'load-path "/your/path/") (require 'moc-player)
where /your/path/
is where you keep moc-player.el
This is how you can have =use-package= (https://github.com/jwiegley/use-package) to load it:
(use-package moc-player :load-path "/your/path/" :bind (("s-m s-m" . mocp-ensure-command) ("s-m a" . mocp-append-file) ("s-m SPC" . mocp-toggle-pause-or-play) ("s-m n" . mocp-next) ("s-m p" . mocp-previous) ("s-m S" . mocp-seek) ("s-m <" . mocp-seek-back) ("s-m >" . mocp-seek-ahead) ("s-m s" . mocp-stop) ("s-m P" . mocp-play-file) ("s-m ." . mocp-track-name-time) ("s-m C" . mocp-clear) ("s-m C-c s" . mocp-shuffle) ("s-m t" . mocp-term) ("" . mocp-previous) ("" . mocp-next) ("" . mocp-toggle-pause-or-play) ("" . mocp-stop)))
You can start MOC with
M-x mocp-ensure-command
or
M-: (mocp-ensure-command)
or, if you used the configuration above for use-package
s-m s-m
If you want to load a file, you can use
=moc-play-file= or moc-append-file
.
I tested this with:
GNU Emacs 27.1 (build 2, x86_64-pc-linux-gnu) 2020-09-08 GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu GTK+ Version 3.24.27, cairo version 1.17.4) 2021-03-26
Music On Console, Version : 2.5.2, Revision : 2930 Compiled with : OSS ALSA JACK Network streams resample Running on : Linux 5.4.51-gnu-1-lts x86_64, Linux 5.13.8-gnu-1 x86_64 Homepage : http://moc.daper.net/