Remove
This commit is contained in:
@@ -1,8 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
|
|
||||||
sticker=$(rmpc sticker get "$FILE" "playCount" | jq -r '.value')
|
|
||||||
if [ -z "$sticker" ]; then
|
|
||||||
rmpc sticker set "$FILE" "playCount" "1"
|
|
||||||
else
|
|
||||||
rmpc sticker set "$FILE" "playCount" "$((sticker + 1))"
|
|
||||||
fi
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
|
|
||||||
LOGFILE="$HOME/.mpd/log"
|
|
||||||
OUTFILE="$HOME/.config/rmpc/genre_counts.txt"
|
|
||||||
TMPFILE="$(mktemp)"
|
|
||||||
|
|
||||||
# Extract and accumulate genres to tmpfile
|
|
||||||
grep "player: played" "$LOGFILE" | while read -r line; do
|
|
||||||
filepath=$(echo "$line" | sed -n 's/.*player: played "\(.*\)"/\1/p')
|
|
||||||
fullpath="$HOME/Music/mpd/$filepath"
|
|
||||||
|
|
||||||
if [ -f "$fullpath" ]; then
|
|
||||||
genre=$(eyeD3 --no-color "$fullpath" | grep "genre:" | sed -E 's/.*genre: (.*) \(id.*/\1/')
|
|
||||||
IFS=';'
|
|
||||||
for g in $genre; do
|
|
||||||
clean_genre=$(echo "$g" | xargs)
|
|
||||||
[ -n "$clean_genre" ] && echo "$clean_genre" >> "$TMPFILE"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Count and sort genres
|
|
||||||
sort "$TMPFILE" | uniq -c | sort -k1 -nr | awk '{ $1=$1; print substr($0, index($0,$2)) " " $1 }' > "$OUTFILE"
|
|
||||||
|
|
||||||
rm "$TMPFILE"
|
|
||||||
echo "✅ Genre frequency list saved to $OUTFILE"
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
|
|
||||||
# Directory where to store temporary data
|
|
||||||
TMP_DIR="/tmp/rmpc"
|
|
||||||
|
|
||||||
# Ensure the directory is created
|
|
||||||
mkdir -p "$TMP_DIR"
|
|
||||||
|
|
||||||
# Where to temporarily store the album art received from rmpc
|
|
||||||
ALBUM_ART_PATH="$TMP_DIR/notification_cover"
|
|
||||||
|
|
||||||
# Path to fallback album art if no album art is found by rmpc/mpd
|
|
||||||
# Change this to your needs
|
|
||||||
DEFAULT_ALBUM_ART_PATH="$TMP_DIR/default_album_art.jpg"
|
|
||||||
|
|
||||||
# Save album art of the currently playing song to a file
|
|
||||||
if ! rmpc albumart --output "$ALBUM_ART_PATH"; then
|
|
||||||
# Use default album art if rmpc returns non-zero exit code
|
|
||||||
ALBUM_ART_PATH="${DEFAULT_ALBUM_ART_PATH}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
MSG_TITLE=$(urlencode "$TITLE")
|
|
||||||
MSG_ARTIST=$(urlencode "$ARTIST")
|
|
||||||
|
|
||||||
# Integrates with hammerspoon, but use whatever terminal notifier you have set up.
|
|
||||||
#open "hammerspoon://canvasNotify?line1=$TITLE&line2=$ARTIST&duration=3"
|
|
||||||
Reference in New Issue
Block a user