Skip to content

Rqver/AudioTUI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AudioTUI

License: MIT

A TUI to manage playback of Online Radio Streams and Plexamp playlists. Designed for Linux desktops and compatibility with Alexays/Waybar.

Picture of the TUI

Why

Inspired by spiercey/plexamp-tui, this project allows you to choose from a radio station (and see what that station is currently playing), or Plexamp playlist, in a keyboard-only form.

Waybar

This project is designed to work with Alexays/Waybar to display the currently playing audio.

Picture of the Project in Waybar Additional Picture of the Project in Waybar

Default Radio Stations

This project is designed to work with any online audio stream as a radio station. The existing configured options are:

You can add any online audio stream as an audio source by following the instructions under Customization and Compiling.

Customization & Compiling

Requirements

  • mpv installed and available in the terminal
  • pkill available in the terminal
  • An instance of Plexamp running on the desktop.

Environment Variables

Rename the .env.example file to .env. The project requires four Plex-related environment variables to successfully run:

  • PLEX_TOKEN: A Plex authentication token. See this Support Article.
  • PLEX_HOST: The IP address and port of your Plex Server.
  • PLEXAMP_CLIENT_NAME: The name of your Plexamp client on your PC. This needs to be unique within your Plex server.
  • PLEXAMP_CLIENT_IP: The IP address of the local Plexamp client. Likely the default value in the .env.example file.

Adding/Customizing Radio Stations

All TS files in radio/stations/ with .station in the file name that export a Station object (see radio/radio-handler.ts) are loaded as radio stations.

Important Notes:

  • id must be unique amongst your radio stations.
  • rank indicates the order they appear in the TUI.
  • You can use jsr:@std/fmt/colors to select the colour of the station in the TUI.

Compiling

This project uses Deno as a runtime.

  • Inside the project directory, use deno install.
  • Once install has completed, use deno task start and run the project to ensure it functions as you intended.
  • Once ready to compile, use deno task compile.

Waybar Setup

This project is designed to be compatible with Alexays/Waybar.

Ensure you have a compiled version of AudioTUI for this step.

Example entry in waybar/config.jsonc:

"custom/media": {
   "format": {},
   "return-type": "json",
   "exec": "/path/to/bin/audio_tui --status",
   "interval": 2
}

You can also style the various stations, or Plexamp, by using waybar/style.css. Use the ids of radio stations, stopped for when nothing is playing, and plexamp for Plexamp. Example:

#custom-media {
    margin-right: 15px;
}

#custom-media.stopped {
    opacity: 0.5;
}

#custom-media.the-breeze {
    color: #6BDCCE;
}

#custom-media.coast {
    color: #49BCC0;
}

#custom-media.rnz-national {
    color: #CB3534;
}

#custom-media.the-sound {
    color: #FFD700;
}

About

A TUI to manage playback of Online Radio Streams and Plexamp Playlists.

Topics

Resources

License

Stars

Watchers

Forks