Krolyxon
Tag v0.1.7

rmptuiREADME.md

231 lines · 7.6 KB · Markdown

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