Initial commit

This commit is contained in:
2025-07-21 14:28:02 +02:00
commit 84bff90664
10 changed files with 184 additions and 0 deletions

6
src/sh/awk.sh Normal file
View File

@@ -0,0 +1,6 @@
AWK_ARTISTS=$(
cat <<'EOF'
@@include awk/artists.awk
EOF
)
export AWK_ARTISTS

3
src/sh/helper.sh Normal file
View File

@@ -0,0 +1,3 @@
err() {
echo "ERROR: ${1:-}"
}

5
src/sh/info.sh Normal file
View File

@@ -0,0 +1,5 @@
APP_NAME="muf"
APP_VERSION="zero.zero"
APP_WEBSITE="https://git.indyfac.ch/amin/muf"
WINDOW_TITLE="🔎🎶 $APP_NAME"
export APP_NAME APP_VERSION APP_WEBSITE WINDOW_TITLE

8
src/sh/mb.sh Normal file
View File

@@ -0,0 +1,8 @@
mb_browse_artists() {
$CURL \
--get \
--data-urlencode fmt=json \
--data-urlencode query="$1" \
-A "$APP_NAME/$APP_VERSION ($APP_WEBSITE)" \
"https://musicbrainz.org/ws/2/artist"
}

7
src/sh/theme.sh Normal file
View File

@@ -0,0 +1,7 @@
COLOR_ARTIST="\033[38;5;227m"
COLOR_DISAMBIGUATION="\033[38;5;110m"
COLOR_RESET="\033[m"
FORMAT_PERSON="${FORMAT_PERSON:-👤 $COLOR_ARTIST<<name>>$COLOR_RESET}"
FORMAT_GROUP="${FORMAT_GROUP:-👥 $COLOR_ARTIST<<name>>$COLOR_RESET}"
FORMAT_DISAMBIGUATION="${FORMAT_DISAMBIGUATION:-$COLOR_DISAMBIGUATION(<<disambiguation>>)$COLOR_RESET}"
export FORMAT_PERSON FORMAT_GROUP FORMAT_DISAMBIGUATION

32
src/sh/tools.sh Normal file
View File

@@ -0,0 +1,32 @@
if command -v "fzf" >/dev/null; then
FZF="fzf --black"
else
err "Did not find the command-line fuzzy finder fzf."
exit 1
fi
export FZF
if command -v "bat" >/dev/null; then
CAT="bat"
elif command -v "batcat" >/dev/null; then
CAT="batcat"
fi
CAT=${CAT:+$CAT --color=always --style=plain --language=md}
CAT=${CAT:-cat}
export CAT
if command -v "curl" >/dev/null; then
CURL="curl --silent"
else
err "Did not find curl."
exit 1
fi
export CURL
if command -v "jq" >/dev/null; then
JQ="jq"
else
err "Did not find jq."
exit 1
fi
export JQ