Krolyxon
Commit fbd9aa5

rmptuiREADME.md

230 lines · 7.5 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
133Every listed action is configurable in `[keybindings]`; each value is an array
134so actions can have multiple aliases. Remove an alias or set an action to `[]`
135to disable it. A key can be a single character or a named key such as `Enter`,
136`Esc`, `Tab`, `Space`, `Up`, `Down`, `Left`, `Right`, or `Backspace`. Add
137modifiers with `Ctrl+`, `Alt+`, or `Shift+`, for example `Ctrl+x` or
138`Alt+Enter`. Bindings are matched in the current UI context, so avoid assigning
139the same key to different actions that can be active in the same context.
140Characters typed into search and playlist-name fields remain text unless
141configured as an input action.
142
143`playback.seek_seconds` sets the `seek_forward`/`seek_backward` distance, and
144`playback.volume_step` sets the `volume_up`/`volume_down` amount. Supported
145audio formats remain built in. The config stores an MPD password as plain text;
146newly created config files are restricted to the current user.
147
148The MPD connection settings can also be overridden with environment variables:
149
150| Variable | Default | Description |
151| --- | --- | --- |
152| `MPD_HOST` | Config file | MPD hostname or address. Use `password@host` to set both host and password. |
153| `MPD_PORT` | Config file | MPD port; an explicit port in `MPD_HOST` takes precedence. |
154
155For example:
156
157```sh
158MPD_HOST=192.168.1.20 MPD_PORT=6600 ./target/release/rmptui
159```
160
161Or, for a password-protected local server:
162
163```sh
164MPD_HOST='secret@localhost' ./target/release/rmptui
165```
166
167## Controls
168
169The keys below are the defaults; edit the `[keybindings]` table above to change
170them.
171
172### Navigation
173
174| Key | Action |
175| --- | --- |
176| `Tab` | Cycle between Queue, Browser, and Playlists |
177| `1` / `2` / `3` | Open Queue / Browser / Playlists |
178| `j` / `Down` | Move selection down |
179| `k` / `Up` | Move selection up |
180| `g` / `G` | Jump to the top / bottom of the current list |
181| `Enter` / `l` / `Right` | Activate the selected item |
182| `h` / `Left` | Go to the parent directory in the browser |
183| `q` / `Ctrl+C` | Quit |
184
185### Search
186
1871. Press `/` and type a query.
1882. In the browser, press `Enter` to keep the query and return to the list.
1893. Press `n` for the next fuzzy match or `N` for the previous match. Results
190 wrap around when you reach either end.
1914. Press `/` to start a new search, or `Esc` to cancel search input.
192
193Search matches the names shown in the current view. Browser search includes
194both folders and songs.
195
196### Playback and queue
197
198| Key | Action |
199| --- | --- |
200| `p` | Toggle play/pause |
201| `s` | Pause |
202| `>` / `<` | Play next / previous track |
203| `f` / `b` | Seek forward / backward by two seconds |
204| `+` / `=` / `-` | Increase / decrease volume |
205| `m` | Toggle mute |
206| `r` / `z` | Toggle repeat / random |
207| `d` | Remove the selected queue item |
208| `Space` | Remove a queue item; toggle a browser song in the queue |
209| `J` / `K` | Move the selected queue item down / up |
210| `c` | Clear the queue |
211| `a` | Open the add-to-playlist menu |
212| `U` | Rescan the MPD music database |
213
214### Playlists
215
216The Playlists view has a playlist pane and a contents pane. Select a playlist
217with `j`/`k` and press `Space` or `Enter` to load it into the queue and start
218playback. Press `Right` or `l` to focus its songs and `Left` or `h` to return
219to the playlist pane. In the contents pane, `j`/`k` selects a song, `Enter`
220plays it, `d` removes it from the saved playlist, and `J`/`K` moves it
221down/up. `D` deletes the selected saved playlist. `R` renames a playlist.
222
223Press `a` to open the add-to-playlist menu; choose **Current Playlist**, **New
224Playlist**, or a saved playlist. When creating a playlist, type its name and
225press `Enter` to save. Playlist contents update after each edit.
226
227## License
228
229rmptui is distributed under the
230[GNU Affero General Public License v3.0](LICENSE).