MCPcopy Create free account
hub / github.com/Immelancholy/Zarumet

github.com/Immelancholy/Zarumet @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
402 symbols 912 edges 61 files ⚖ MIT 136 documented · 34% ● updated 54d ago★ 354 open issues

Browse by type

⨍ Functions 359◇ Types & classes 43
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

🦀 Zarumet 🦀

Introduction

Zarumet is an mpd client for the terminal written in Rust.

Zarumet Screenshot

Zarumet Screenshot 2

Dependencies

  • mpd
  • A NerdFont
  • A terminal emulator that supports truecolor and UTF-8 encoding.
  • Pipewire and libpipewire specifically (pipewire-devel on fedora for example)
  • Clang
  • Pkg-Config
  • Albumartist as part of the metadata_to_use in mpd config (maybe but I think so)

🦀 Installation

cargo install zarumet

❄️ NixOS installation via flake

Click to expand NixOS installation instructions

Add the zarumet repo as a flake input:

{
   inputs = {
       zarumet = {
           url = "github:Immelancholy/zarumet";
           inputs.nixpkgs.follows = "nixpkgs";
       };
   };
}

Add the zarumet package to your system configuration:

{pkgs, inputs, ...}: {
    environment.systemPackages = with pkgs; [
        inputs.zarumet.packages.${pkgs.stdenv.hostPlatform.system}.default
    ];
}

Click to expand NixOS installation via flakes and home manager

Add the zarumet repo as a flake input:

{
   inputs = {
       zarumet = {
           url = "github:Immelancholy/zarumet";
           inputs.nixpkgs.follows = "nixpkgs";
       };
   };
}

Add the zarumet module to your homemanager config:

  home-manager.users.your-user = {
    imports = [
      inputs.zarumet.homeModules.default
    ];
  };

Enable the zarumet program and configure to your liking:

{
  programs.zarumet = {
    enable = true;
    settings = {
      mpd = {
        address = "localhost:6600";
      };
      colors = {
        album = "#fae280";
        artist = "#fae280";
        border = "#fae280";
        status = "#fae280";
        title = "#fae280";
      };
      pipewire = {
        bit_perfect_enabled = false;
      };
    };
  };
}

Usage

A TUI MPD client with album art

Usage: zarumet [OPTIONS]

Options:
  -c, --config <CONFIG>            Path to config file
  -a, --address <ADDRESS>          MPD server address (overrides config)
  -b, --bit-perfect <BIT_PERFECT>  Set bit-perfect mode (PipeWire sample rate matching): "on" or "off"
      --generate-config [<PATH>]   Generate default config file at the specified path (or ./config.toml if not specified)
  -h, --help                       Print help
  -V, --version                    Print version

Directories

Press 6 to browse MPD's music directory. Folders appear first with a trailing slash, followed by files; the current MPD path appears above the list.

  • j/k or Down/Up: select an entry; gg/G and Ctrl-U/Ctrl-D jump or page.
  • h / Left, l / Right: focus the directory pane or its contents.
  • Enter: open the focused folder, or append the focused file.
  • Backspace: move the left pane up to its parent and select the folder you left.
  • a: append the selected file or the selected folder recursively.
  • u: refresh the current directory. MPD database updates also refresh it.

Browsing does not change playback. Adding appends without starting, stopping or replacing the current queue. Folder expansion runs on MPD, including when the server is remote; paths are never resolved against the client filesystem. A failed recursive add may have appended some entries; the error is displayed and the queue is refreshed to reflect MPD's actual state.

The left pane shows the current directory; the right previews the selected folder. Entering a folder moves its contents into the left pane. Both listings load asynchronously. Empty folders are shown when MPD exposes them; database updates may omit empty folders. The current-song artwork follows playback, as in the other views.

Stored playlists

Press 7 for MPD stored playlists. The left panel lists names and the right panel shows the selected playlist's tracks. Use the existing movement and panel keys; browsing does not change the playback queue.

  • a / Enter: append the selected playlist from the names panel, or just the selected track from the tracks panel, without interrupting playback.
  • Shift-P: replace the queue and play the playlist, after Enter confirms the prompt. Esc cancels. Empty or unavailable playlists leave the queue intact.
  • Shift-S in Queue or Playlists: save the current queue under a new name. Enter saves, Esc cancels, Backspace edits, and Ctrl-U clears the name. Unicode names and empty queues are supported; an existing playlist is never overwritten.
  • Shift-R: rename the selected playlist. The current name is prefilled; Ctrl-U clears it. Existing destinations are never overwritten.
  • Shift-D: delete the selected playlist after a named confirmation. Esc cancels. Rename and delete leave the playback queue and music files unchanged.
  • u in Playlists: refresh saved playlists. Changes from other MPD clients also refresh automatically, preserving selection by name where possible.

These actions are configurable in [binds] (see below). Keys 1–5 retain their existing meanings; 6 is unassigned. Use h/l (or the configured panel keys) to focus names or tracks. Shift-P always replaces and plays the whole playlist; a/Enter adds the focused selection.

Playlist data stays on MPD. Replace-and-play stages tracks before removing old queue entries, so a missing track does not first destroy the old queue. MPD operations are not atomic: connection loss or a failure during removal/playback can leave a partial result. Zarumet reports the error and refreshes the queue; it does not claim to roll back changes from other clients.

Configuration

Configuration is stored in a TOML file. The default location is: ~/.config/zarumet/config.toml. You can override this with the -c flag.

Zarumet will fill in missing config fields with their default values. This means if you wanted to unbind a keybinding you cannot uncomment it.

Instead you would leave it as an empty list to show that there are no bindings assigned to the action:

clear_queue = []

Default Configuration:

[mpd]
address = "localhost:6600"
volume_increment = 5
volume_increment_fine = 1

[colors]
border = "#fae280"
song_title = "#fae280"
album = "#26a0a1"
artist = "#d67751"
border_title = "#8193af"
progress_filled = "#26a0a1"
progress_empty = "#1b1d0e"
paused = "#e16a7c"
playing = "#e16a7c"
stopped = "#e16a7c"
time_separator = "#e16a7c"
time_duration = "#e16a7c"
time_elapsed = "#e16a7c"
queue_selected_highlight = "#b18a4a"
queue_selected_text = "#1b1d0e"
queue_album = "#26a0a1"
queue_song_title = "#fae280"
queue_song_playing = "#8193af"
queue_artist = "#d67751"
queue_position = "#e16a7c"
queue_duration = "#e16a7c"
top_accent = "#e16a7c"
volume = "#26a0a1"
volume_empty = "#1b1d0e"
mode = "#fae280"
track_duration = "#e16a7c"
border_selected = "#b18a4a"

[binds]
next = [
    ">",
    "shift-j",
    "shift-down",
]
previous = [
    "<",
    "shift-k",
    "shift-up",
]
toggle_play_pause = [
    "space",
    "p",
]
volume_up = ["="]
volume_up_fine = ["+"]
volume_down = ["-"]
volume_down_fine = ["_"]
toggle_mute = ["m"]
cycle_mode_right = [
    "ctrl-l",
    "ctrl-right",
]
cycle_mode_left = [
    "ctrl-h",
    "ctrl-left",
]
clear_queue = ["d d"]
repeat = ["r"]
random = ["z"]
single = ["s"]
consume = ["c"]
quit = [
    "esc",
    "q",
    "ctrl-c",
    "shift-z shift-z",
]
refresh = ["u"]
switch_to_queue_menu = ["1"]
switch_to_artists = ["2"]
switch_to_albums = ["3"]
switch_to_years = ["4"]
switch_to_genres = ["5"]
switch_to_directories = ["6"]
open_directory = ["enter"]
parent_directory = ["backspace"]
add_directory_selection = ["a"]
switch_to_playlists = ["7"]
play_playlist = ["shift-p"]
rename_playlist = ["shift-r"]
delete_playlist = ["shift-d"]
add_playlist_to_queue = ["a", "enter"]
save_queue_as_playlist = ["shift-s"]
seek_forward = [
    "shift-l",
    "shift-right",
]
seek_backward = [
    "shift-h",
    "shift-left",
]
scroll_up = [
    "k",
    "up",
]
scroll_down = [
    "j",
    "down",
]
play_selected = [
    "enter",
    "l",
    "right",
]
remove_from_queue = [
    "x",
    "backspace",
]
move_up_in_queue = [
    "ctrl-k",
    "ctrl-up",
]
move_down_in_queue = [
    "ctrl-j",
    "ctrl-down",
]
switch_panel_left = [
    "h",
    "left",
]
switch_panel_right = [
    "l",
    "right",
]
toggle_album_expansion = [
    "l",
    "right",
]
add_to_queue = [
    "a",
    "enter",
]
scroll_up_big = ["ctrl-u"]
scroll_down_big = ["ctrl-d"]
go_to_top = ["g g"]
go_to_bottom = ["shift-g"]
toggle_bit_perfect = ["b"]

[pipewire]
bit_perfect_enabled = false

[logging]
enabled = true
level = "info"
log_to_console = false
append_to_file = true
rotate_logs = true
rotation_size_mb = 10
keep_log_files = 5

Bit-Perfect Mode (PipeWire)

Zarumet supports bit-perfect audio playback by automatically adjusting PipeWire sample rate to match the current song's sample rate. This prevents resampling and ensures the highest quality audio output.

Requirements

  • PipeWire audio server
  • MPD configured to output through PipeWire

Configuration

To enable bit-perfect mode, add a [pipewire] section to your config file:

[pipewire]
bit_perfect_enabled = true

When enabled, Zarumet will automatically discover the supported sample rates from your PipeWire audio system and hardware, eliminating the need for manual configuration. The system will:

  1. Query PipeWire for available sample rates from your audio devices
  2. Fall back to common sample rates if automatic detection fails
  3. Dynamically select the optimal rate for each song

Usage

Once enabled in the configuration, toggle bit-perfect mode on/off with b (default keybind). The mode indicator will appear in the UI when enabled.

When a song plays, Zarumet will automatically:

  1. Use the song's native sample rate if it's supported by your audio hardware
  2. Otherwise, select the highest compatible supported rate
  3. Fall back to 44100 Hz if no compatible rate is found

The system supports common sample rates including:

  • 44100 - CD quality
  • 48000 - DVD/common digital audio
  • 88200 - 2x CD quality
  • 96000 - High-resolution audio
  • 176400 - 4x CD quality
  • 192000 - High-resolution audio
  • 352800 - DXD quality
  • 384000 - Ultra high-resolution audio

CLI Option

You can also set the initial bit-perfect state via the command line:

zarumet --bit-perfect on   # Start with bit-perfect enabled
zarumet --bit-perfect off  # Start with bit-perfect disabled

The state is persisted between sessions.

⚡ Inspired By

Extension points exported contracts — how you extend this code

browse all types & interfaces →

Core symbols most depended-on inside this repo

browse all functions →

Shape

Method 265
Function 94
Class 30
Enum 8
Interface 5

Languages

Rust100%

Modules by API surface

src/app/config/colors.rs57 symbols
src/app/config/binds.rs53 symbols
src/app/ui/cache/dirty.rs31 symbols
src/app/ui/cache/width_cache.rs28 symbols
src/app/ui/cache/render_cache.rs28 symbols
src/app/ui/cache/cover_cache.rs19 symbols
src/app/ui/rendering/utils.rs15 symbols
src/app/audio/pipewire.rs13 symbols
src/app/logging.rs12 symbols
src/app/song/library.rs10 symbols
src/app/binds_handler.rs10 symbols
src/app/config/logging.rs9 symbols

For agents

$ claude mcp add Zarumet \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page