dmenu-radio
A dmenu launcher for radiotray-ng: hit a key, pick an internet radio station from a dmenu list, and it starts playing. No tray icon, no window. In dwm a keybinding plus dmenu is the entire interface, and a system tray is the one part of radiotray-ng I didn’t want.
Stations show up as Group / Name - Jazz / KMHD - and selecting one
calls radiotray-ng’s play_station over D-Bus. If radiotray-ng isn’t
running yet the script starts it in the background and waits for it to
appear on the session bus, so the keybinding works from a cold start
rather than failing the first time you press it. There’s also a
--standalone mode that drops radiotray-ng entirely and plays through
mpv --no-video, driven over mpv’s JSON IPC socket; if an mpv instance
is already listening there, the new station is sent to it instead of
spawning a second player.
Station data comes from radiotray-ng’s own bookmarks file, but an
optional bookmarks.org takes priority, which is much nicer to
edit. Those play through play_url, so they don’t have to exist in
radiotray-ng’s bookmarks at all.
The remaining flags are conveniences for the dwm setup: --toggle for
a single-key play/stop binding, and --status, which prints the
current Artist - Title (or the station name, if the stream sends no
metadata) and nothing when stopped, so it drops straight into slstatus
as a run_command. It’s one Python script, standard library only.
The code is here on GitHub.