~tardypad/dotfiles

ref: 00c0c349a1b8960152233f11caa9ea1a40e395a3 dotfiles/files/scripts/shell/play-somafm -rwxr-xr-x 393 bytes
00c0c349 — Damien Tardy-Panis Add presentation mode to mako to hide notifications 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh

CHANNELS=$( somafm channels )

CHANNEL_NAME=$(
  echo "${CHANNELS}" \
    | cut -f2 \
    | sort \
    | bemenu -p 'Play SomaFM channel'
)

[ -n "${CHANNEL_NAME}" ] || exit

CHANNEL_ID=$(
  echo "${CHANNELS}" \
    | cut -f1,2 \
    | grep "${CHANNEL_NAME}" \
    | cut -f1
)

CHANNEL_URL=$( somafm direct_url "${CHANNEL_ID}" )

mpc -q clear
mpc -q add "${CHANNEL_URL}"
mpc -q play