2020-03-01 19:59:28 +00:00
# di-tui
2024-05-05 18:13:57 +00:00
2020-11-15 17:05:46 +00:00
A simple terminal UI player for [di.fm Premium ](http://di.fm )
2020-03-02 01:57:23 +00:00
2025-02-09 16:16:47 +00:00
[](https://repology.org/project/di-tui/versions)
2023-09-15 07:57:22 +00:00

2020-02-24 02:47:42 +00:00
2025-02-09 16:16:47 +00:00
---
2024-05-05 18:13:57 +00:00
This app began as di.fm player, but now supports the whole Audio Addict network
2020-11-15 17:05:46 +00:00
2024-05-05 18:13:57 +00:00
- Classical Radio
- DI.fm
- Radio Tunes
- Rock Radio
- Jazz Radio
- Zen Radio
2020-11-08 18:22:32 +00:00
2025-02-09 16:16:47 +00:00
## Run / Install
2020-12-03 19:33:07 +00:00
2023-07-08 14:39:12 +00:00
### Binary Releases
2020-04-11 15:23:36 +00:00
2025-02-09 16:16:47 +00:00
Binary releases are available in [releases ](https://github.com/acaloiaro/di-tui/releases ).
### `go install`
2020-04-11 15:23:36 +00:00
2022-01-17 19:14:25 +00:00
`go install github.com/acaloiaro/di-tui@latest`
2020-02-24 02:47:42 +00:00
2025-02-09 16:16:47 +00:00
### Nixpkgs (currently unstable channel only)
`di-tui` is currently in nixpkgs/nixos-unstable.
### Run the flake
2020-03-01 22:54:39 +00:00
2023-08-24 07:26:45 +00:00
```
nix run github:acaloiaro/di-tui
```
2020-03-01 22:54:39 +00:00
2024-05-05 18:13:57 +00:00
## Usage
### Authenticate
2020-02-24 02:47:42 +00:00
2020-12-15 01:16:36 +00:00
There are two authentication options
2020-09-25 15:05:36 +00:00
2024-05-05 18:13:57 +00:00
- Enter your username and password directly into `di-tui` with the `--username` and `--password` switches
- If you're justifiably uncomfortable with entering your username/password into this application, copy your "Listen Key" from (https://www.di.fm/settings) and create the following file:
2024-02-24 17:34:24 +00:00
2024-05-05 19:41:18 +00:00
#### ~/.config/di-tui/config.yml
```yml
token: < YOUR LISTEN KEY >
album_art: < BOOLEAN >
```
| key | description |
| --- | ----------- |
| token | **string** Your di.fm authentication "Listen Key" found at https://www.di.fm/settings |
2025-02-09 16:16:47 +00:00
| album_art | **boolean** Enable/disable album ASCII art |
2024-05-05 19:41:18 +00:00
2024-05-05 18:13:57 +00:00
### Choose a network
2024-02-24 17:34:24 +00:00
2024-05-05 18:13:57 +00:00
DI.fm is the default network, but other audio addict networks can be chosen with the `--network` switch.
2020-09-25 15:05:36 +00:00
2024-05-05 18:13:57 +00:00
| switch value | network |
| --- | ----------- |
| classicalradio | Classical Radio [https://classicalradio.com ](https://classicalradio.com ) |
| di | DI.fm [https://di.fm ](https://di.fm ) |
| radiotunes | Radio Tunes [https://radiotunes.com ](https://radiotunes.com ) |
| rockradio | Rock Radio [https://rockradio.com ](https://rockradio.com )|
| jazzradio | Jazz Radio [https://jazzradio.com ](https://jazzradio.com )|
| zenradio | Zen Radio [https://zenradio.com ](https://zenradio.com )|
2025-11-18 13:55:18 +00:00
### Favorites
Favorites must be edited on the web player (e.g. at [DI.fm ](https://di.fm )) and cannot be
edited via this app. It used to be possible to edit favorites from this app, but DI.fm
introduced limitations on their API.
2024-05-05 18:13:57 +00:00
## Dependencies
### PulseAudio
Both linux and MacOS depend on pulseaudio to be running.
#### MacOS
By default, pulseaudio on MacOS runs as "root", which is not ideal. PulseAudio is best run by non-root users. By symbolically linking the pulseaudio plist file into your user's `~/Library/LaunchAgents/` , it runs as your user.
```
brew install pulseaudio
ln -s $(brew info pulseaudio | grep "/usr/local/Cellar" | awk '{print $1}')//homebrew.mxcl.pulseaudio.plist ~/Library/LaunchAgents
brew services start pulseaudio
```
#### Debian / Ubuntu
`apt install pulseaudio`
2020-12-15 01:16:36 +00:00
2024-01-17 21:08:14 +00:00
## MPRIS/D-bus support
MPRIS is a D-Bus specification allowing media players to be controlled in a standardized way, e.g. with `playerctl` .
2024-05-05 18:13:57 +00:00
`di-tui` supports a very limited set of MPRIS commands. The limited set is due to the fact that `di-tui` is a streaming audio player, and it doesn't make sense to support `next` , `previous` , `seek` , etc., because audio streams have no next or previous track; or the ability to seek forward.
2024-01-17 21:08:14 +00:00
### Supported MPRIS commands
`play-pause` Toggles Play/Pause, e.g. `playerctl --player=di-tui play-pause` toggles play/pause on di-tui if it's the active player
### Supported MPRIS metadata
`track` The currently playing track
`artist` The currently playing artist
`status` The status of the player, e.g. `playing` , `paused` , `stopped`
`playerName` The name of the player: `di-tui`
2023-07-08 14:39:12 +00:00
## Configuration
### Themes
By default, `di-tui` respects your terminal's color scheme. However, there are four color settings that one can change by adding a `theme` to `config.yml` .
**Tomorrow-Night** inspired theme
```yml
theme:
primary_color: "#81a2be"
background_color: "#2a1f1a"
primary_text_color: "#969896"
secondary_text_color: "#81a2be"
```