47 lines
833 B
Bash
Executable File
47 lines
833 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Gruvbox
|
|
col_gray1="#1d2021"
|
|
col_gray2="#504945"
|
|
col_gray3="#ebdbb2"
|
|
col_gray4="#ebdbb2"
|
|
col_main="#3c3836"
|
|
|
|
# Font
|
|
font="JetBrainsMono Nerd Font Propo:size=14"
|
|
|
|
# Prompt
|
|
prompt="Select a stream to watch:"
|
|
|
|
# Dimentions
|
|
rows=10
|
|
cols=1
|
|
|
|
MS_BIN="$HOME/.local/bin"
|
|
MS_NAME="muni-streamer"
|
|
MS_CONFIG="$HOME/.config/$MS_NAME"
|
|
|
|
declare -A items
|
|
|
|
while IFS= read -r line; do
|
|
[[ -z "$line" ]] && continue
|
|
read -r key val <<< "$line"
|
|
items["$key"]="$val"
|
|
done < $MS_CONFIG/streams.txt
|
|
|
|
|
|
DMENU_OPTS=(
|
|
-l "$rows" -g "$cols"
|
|
-nb "$col_gray1" -nf "$col_gray3"
|
|
-sb "$col_main" -sf "$col_gray4"
|
|
-fn "$font" -p "$prompt"
|
|
)
|
|
|
|
choice=$(
|
|
for key in "${!items[@]}"; do
|
|
printf '%s - %s\n' "$key" "${items[$key]}"
|
|
done | dmenu "${DMENU_OPTS[@]}"
|
|
)
|
|
|
|
[ "$choice" != "" ] && mpv ${choice#* -}
|