Skip to content

skissue/elfin

Repository files navigation

Elfin

A Jellyfin music player for Emacs using mpv.

Work-in-progress! Many features are still missing/half-baked.

Table of Contents

Installation

This package is not yet in any repositories. Install it with your favorite from-Git method!

Requirements

Manual

Clone this repository and add it to your load-path:

(add-to-list 'load-path "/path/to/elfin") (require 'elfin)

Usage

Authentication

Authenticate with your Jellyfin server using one of the following methods:

M-x elfin-quick-connect
Authenticate by providing a server URL, and then using Quick Connect (preferred).
M-x elfin-authenticate
Authenticate using the standard server URL, username, password flow.

Sessions are stored in memory by default. To persist sessions across Emacs restarts, set elfin-session-file before authenticating:

(setopt elfin-session-file (expand-file-name "elfin-sessions" user-emacs-directory))

Use M-x elfin-restore-sessions to reload saved sessions.

To manage sessions:

M-x elfin-delete-session
Delete a specific session.
M-x elfin-delete-all-sessions
Delete all sessions.

Browsing

Browse your Jellyfin library with the following entry points:

CommandBinding (in view)Description
elfin-albums1List all albums
elfin-artists2List all artists
elfin-tracks3List all tracks
elfin-playlists4List all playlists

Items are displayed in a tabulated list with thumbnails. Within a view buffer:

KeyCommandDescription
RETelfin-items-openOpen item (open album/artist, or play track)
aelfin-items-queueAdd item to playback queue
C-<return>elfin-items-playPlay item, replacing current queue
selfin-items-searchSearch within current view
Selfin-items-clear-searchClear search filter
Nelfin-items-next-pageNext page of results
Pelfin-items-prev-pagePrevious page of results

Playback

Playback is handled via mpv, which is started automatically when needed.

CommandDescription
elfin-pauseToggle pause
elfin-stopStop playback and clear queue
elfin-volume-upIncrease volume
elfin-volume-downDecrease volume
elfin-volume-setSet volume to a specific value
elfin-loop-trackToggle track looping
elfin-loop-playlistToggle playlist looping
elfin-clear-queueClear the playback queue
elfin-killKill the mpv process

Customization

VariableDefaultDescription
elfin-session-filenilFile to persist sessions across restarts
elfin-default-volume100Default mpv volume (0–100)
elfin-volume-step5Step size for volume up/down
elfin-replaygainnilReplayGain mode (nil, track, or album)
elfin-mpv-extra-optionsnilExtra command-line options for mpv

Hooks (advanced)

Elfin provides hooks for integrating with other packages:

elfin-file-start-hook
Run when a new file starts playing (receives track ID).
elfin-file-end-hook
Run when a file finishes (receives track ID and reason).
elfin-pause-hook
Run when pause state changes (receives non-nil if paused).
elfin-idle-hook
Run when mpv enters idle state.

Example Configuration

(require 'elfin) (setopt elfin-session-file (expand-file-name "elfin-sessions" user-emacs-directory) elfin-default-volume 80 elfin-volume-step 5 elfin-replaygain 'album) (elfin-restore-sessions) ;; Optional: ListenBrainz scrobbling (require 'elfin-listenbrainz) (setopt elfin-listenbrainz-token "your-token-here") (elfin-listenbrainz-mode 1)

Extras

The extras/ directory includes optional, self-contained extensions that extend Elfin in various ways.

elfin-listenbrainz

A global minor mode for scrobbling tracks to ListenBrainz (or any compatible API).

(setopt elfin-listenbrainz-token "your-token-here") (elfin-listenbrainz-mode 1)

Roadmap

  • [ ] Rework keymaps
  • [ ] Shuffle
  • [ ] Queue view
  • [ ] Now-playing display and modeline indicator (maybe extra)
  • [ ] Lyrics support
  • [ ] Global live search with Consult (extra)
  • [ ] Offline caching

License

Elfin is licensed under the GNU General Public License v3.0.

Releases

No releases published

Contributors