Krolyxon
Commit c847cda

rmptuiREADME.md

234 lines · 7.7 KB · Markdown

1# rmptui
2
3![Release](https://img.shields.io/github/v/release/krolyxon/rmptui?color=%23c694ff)
4[![GitHub Downloads](https://img.shields.io/github/downloads/krolyxon/rmptui/total.svg?label=GitHub%20downloads)](https://github.com/krolyxon/rmptui/releases)
5
6**A fast, keyboard-driven MPD client for your terminal.**
7
8rmptui is a lightweight music player interface for [Music Player Daemon
9(MPD)](https://www.musicpd.org/). Browse your library, manage the play queue,
10work with playlists, and control playback without leaving the terminal.
11
12![rmptui screenshot](https://raw.githubusercontent.com/krolyxon/rmptui/master/assets/ss.png)
13
14## Highlights
15
16- **Three focused views:** browse your music library, control the current queue,
17 and inspect saved playlists.
18- **Metadata at a glance:** see artist, track, title, album, and duration in
19 the browser and queue.
20- **Fuzzy, repeatable search:** search the current view with `/`; in the song
21 browser, keep the query and cycle matching folders and songs with `n` and
22 `N`.
23- **Playlist tools:** load playlists, add selected tracks or folders to a
24 playlist, create playlists, and rename them.
25- **Queue control:** play, remove, reorder, and append tracks.
26- **Responsive MPD updates:** the client uses MPD's asynchronous `idle`
27 notifications instead of regularly polling the server.
28- **Direct MPD connection:** speaks MPD's standard text protocol over
29 asynchronous TCP; no `mpd` crate or WebSocket proxy is required.
30
31## Requirements
32
33- A running MPD server with its music library configured.
34- Rust and Cargo to build from source.
35
36## Install
37
38From a local checkout, run the installer to build the release executable and
39copy it to `/usr/local/bin/rmptui`:
40
41```sh
42./install.sh
43```
44
45The script uses `sudo` for the system-directory operations when needed. It
46requires Rust and Cargo to build from source. To use a different binary
47directory or uninstall rmptui:
48
49```sh
50./install.sh --bin-dir "$HOME/.local/bin"
51./install.sh --uninstall
52```
53
54Uninstall from a custom directory with
55`./install.sh --uninstall --bin-dir "$HOME/.local/bin"`. Run
56`./install.sh --help` for usage.
57
58## Build from source
59
60```sh
61git clone https://github.com/krolyxon/rmptui.git
62cd rmptui
63cargo run --release
64```
65
66To build and run without installing, use `cargo run --release`.
67
68On first launch, rmptui creates a default configuration file at
69`$CONFIG_HOME/rmptui/config.toml`. If `CONFIG_HOME` is not set, it uses
70`$XDG_CONFIG_HOME/rmptui/config.toml`, then `~/.config/rmptui/config.toml`.
71Edit the file and restart rmptui to apply changes:
72
73```toml
74[mpd]
75host = "127.0.0.1"
76port = 6600
77password = "" # Set this only if your MPD server requires a password.
78
79[playback]
80seek_seconds = 2
81volume_step = 2
82
83[keybindings]
84quit = ["q", "Ctrl+c"]
85clear_queue = ["c", "C"]
86toggle_pause = ["p"]
87pause = ["s"]
88toggle_repeat = ["r"]
89toggle_random = ["z"]
90open_playlist_menu = ["a"]
91seek_forward = ["f"]
92seek_backward = ["b"]
93cycle_tabs = ["Tab"]
94select_queue = ["1"]
95select_browser = ["2"]
96select_playlists = ["3"]
97next_track = [">"]
98previous_track = ["<"]
99volume_up = ["=", "+"]
100volume_down = ["-"]
101toggle_mute = ["m"]
102update_database = ["U"]
103search = ["/"]
104toggle_selected_item = ["Space"]
105search_next = ["n"]
106search_previous = ["N"]
107move_down = ["j", "Down"]
108move_up = ["k", "Up"]
109activate = ["Enter", "l", "Right"]
110go_back = ["h", "Left"]
111go_to_top = ["g"]
112go_to_bottom = ["G"]
113queue_delete = ["d"]
114queue_move_down = ["J"]
115queue_move_up = ["K"]
116playlist_rename = ["R"]
117playlist_focus_contents = ["Right", "l"]
118playlist_focus_list = ["Left", "h"]
119playlist_delete_song = ["d"]
120playlist_move_song_down = ["J"]
121playlist_move_song_up = ["K"]
122playlist_delete = ["D"]
123playlist_load = ["Space", "Enter"]
124popup_close = ["q", "Esc"]
125popup_select = ["Enter"]
126input_cancel = ["Esc"]
127input_backspace = ["Backspace"]
128input_cursor_left = ["Left"]
129input_cursor_right = ["Right"]
130input_submit = ["Enter"]
131```
132
133Runtime errors and panic details are appended to `/tmp/rmptui.log`. If logging
134cannot be initialized, rmptui prints a warning and continues without a log
135file.
136
137Every listed action is configurable in `[keybindings]`; each value is an array
138so actions can have multiple aliases. Remove an alias or set an action to `[]`
139to disable it. A key can be a single character or a named key such as `Enter`,
140`Esc`, `Tab`, `Space`, `Up`, `Down`, `Left`, `Right`, or `Backspace`. Add
141modifiers with `Ctrl+`, `Alt+`, or `Shift+`, for example `Ctrl+x` or
142`Alt+Enter`. Bindings are matched in the current UI context, so avoid assigning
143the same key to different actions that can be active in the same context.
144Characters typed into search and playlist-name fields remain text unless
145configured as an input action.
146
147`playback.seek_seconds` sets the `seek_forward`/`seek_backward` distance, and
148`playback.volume_step` sets the `volume_up`/`volume_down` amount. Supported
149audio formats remain built in. The config stores an MPD password as plain text;
150newly created config files are restricted to the current user.
151
152The MPD connection settings can also be overridden with environment variables:
153
154| Variable | Default | Description |
155| --- | --- | --- |
156| `MPD_HOST` | Config file | MPD hostname or address. Use `password@host` to set both host and password. |
157| `MPD_PORT` | Config file | MPD port; an explicit port in `MPD_HOST` takes precedence. |
158
159For example:
160
161```sh
162MPD_HOST=192.168.1.20 MPD_PORT=6600 ./target/release/rmptui
163```
164
165Or, for a password-protected local server:
166
167```sh
168MPD_HOST='secret@localhost' ./target/release/rmptui
169```
170
171## Controls
172
173The keys below are the defaults; edit the `[keybindings]` table above to change
174them.
175
176### Navigation
177
178| Key | Action |
179| --- | --- |
180| `Tab` | Cycle between Queue, Browser, and Playlists |
181| `1` / `2` / `3` | Open Queue / Browser / Playlists |
182| `j` / `Down` | Move selection down |
183| `k` / `Up` | Move selection up |
184| `g` / `G` | Jump to the top / bottom of the current list |
185| `Enter` / `l` / `Right` | Activate the selected item |
186| `h` / `Left` | Go to the parent directory in the browser |
187| `q` / `Ctrl+C` | Quit |
188
189### Search
190
1911. Press `/` and type a query.
1922. In the browser, press `Enter` to keep the query and return to the list.
1933. Press `n` for the next fuzzy match or `N` for the previous match. Results
194 wrap around when you reach either end.
1954. Press `/` to start a new search, or `Esc` to cancel search input.
196
197Search matches the names shown in the current view. Browser search includes
198both folders and songs.
199
200### Playback and queue
201
202| Key | Action |
203| --- | --- |
204| `p` | Toggle play/pause |
205| `s` | Pause |
206| `>` / `<` | Play next / previous track |
207| `f` / `b` | Seek forward / backward by two seconds |
208| `+` / `=` / `-` | Increase / decrease volume |
209| `m` | Toggle mute |
210| `r` / `z` | Toggle repeat / random |
211| `d` | Remove the selected queue item |
212| `Space` | Remove a queue item; toggle a browser song in the queue |
213| `J` / `K` | Move the selected queue item down / up |
214| `c` | Clear the queue |
215| `a` | Open the add-to-playlist menu |
216| `U` | Rescan the MPD music database |
217
218### Playlists
219
220The Playlists view has a playlist pane and a contents pane. Select a playlist
221with `j`/`k` and press `Space` or `Enter` to load it into the queue and start
222playback. Press `Right` or `l` to focus its songs and `Left` or `h` to return
223to the playlist pane. In the contents pane, `j`/`k` selects a song, `Enter`
224plays it, `d` removes it from the saved playlist, and `J`/`K` moves it
225down/up. `D` deletes the selected saved playlist. `R` renames a playlist.
226
227Press `a` to open the add-to-playlist menu; choose **Current Playlist**, **New
228Playlist**, or a saved playlist. When creating a playlist, type its name and
229press `Enter` to save. Playlist contents update after each edit.
230
231## License
232
233rmptui is distributed under the
234[GNU Affero General Public License v3.0](LICENSE).