This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Script to create SomaFM playlists based on XML channel data | |
# The script will create playlists in directories named after the playlist type (e.g., fastpls-mp3). | |
# It can handle multiple types of playlists, and will clean up existing playlists before creating new ones. | |
# Base directory for all playlists | |
BASE_DIR="./playlists" | |
# Define valid playlist types and their mappings using an associative array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# AUTHOR: bonelifer | |
# FILE: songlengthtest.sh | |
# ROLE: Display the current song title with length constraints for better readability. | |
# BASED ON: https://gist.github.com/professorjamesmoriarty/2d4fcea1f587750b7bfc | |
# CREATED: 2015-09-27 06:31:51 | |
# MODIFIED: 2025-02-06 | |
# Function to display the currently playing song's title. | |
mus() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Automatically removes songs from your playlist that match a blacklist or the Christmas genre | |
# unless it is between the day after U.S. Thanksgiving and before January 15. | |
BLACKLIST=/var/music/blacklist.txt | |
MPD_HOST=localhost | |
REJECT_GENRE="Christmas" | |
# Define the date range |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
# Script: MPD Duplicate Removal | |
# Purpose: This script identifies and removes duplicate entries from an MPD playlist. | |
# It finds the first duplicate based on file names, and removes it from the playlist. | |
# The script continues removing duplicates until there are no more left. | |
# | |
# Functions: | |
# 1. mpd_first_duplicate: Identifies the position of the first duplicate file in the playlist. | |
# 2. mpd_delete_duplicates: Loops through the playlist and deletes duplicates using the first function. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Send notification with album art (if found) when mpd plays a new song, depends on libnotify | |
readonly MUSIC_DIR="${HOME}/Music" | |
while true; do | |
SONG_PATH="$(mpc --format '%file%' current --wait)" | |
if [[ ! -z "$SONG_PATH" ]]; then # check if song is being played | |
SONG_DIR="$(dirname "${SONG_PATH}")" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# ----------------------------------------------------------------------------- | |
# Script: mpc_state_manager.sh | |
# Description: | |
# This script manages saving and loading the current track and playback state | |
# of the MPD (Music Player Daemon) client `mpc` to/from a file. It provides | |
# two main operations: | |
# 1. Saving the current track and its state (playing/paused) into a file. | |
# 2. Loading a previously saved track and state, and resuming playback. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Icon Definitions (Nerd Font Icons) | |
# Define custom icons for different playback states (play, pause, stop, etc.) | |
PLAY_ICON="" | |
PAUSE_ICON="" | |
STOP_ICON="" | |
NEXT_ICON="" | |
PREV_ICON="" | |
VOLUME_UP_ICON="" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This script interacts with the `mpc` (Music Player Client) to manage playlists in MPD (Music Player Daemon). | |
# It allows the user to perform operations such as: | |
# - Viewing the current playlist with enumerated items. | |
# - Selecting, loading, or replacing playlists interactively. | |
# - Clearing the current playlist and loading a new one. | |
# Usage: | |
# - Run the script with no arguments to execute `mpc` commands. | |
# - Use specific arguments like 'playlist', 'iload', or 'replace' to invoke specialized functions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Script to interact with the music queue and manage song ratings and statuses using "stickers" | |
# The stickers feature is used for marking songs with specific labels (e.g., "broken" or "rating"). | |
# This script supports rating songs, flagging songs as "bad" (broken), removing songs from the queue, | |
# listing songs flagged as bad, and jumping to a random song in the queue. | |
# Ratings are compatible with clients such as Cantata, mpedv, and myMPD. | |
# Function to display usage instructions | |
usage () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
expireTime="9200" | |
mpddir="/media/william/NewData/Music/MP3B/" | |
defaultimage="$mpddir/unknown.jpg" | |
update_cover() { | |
path=$mpddir$(mpc -f %file% current) | |
album=$(mpc -f %file% current) | |
ffmpeg -loglevel quiet -y -i "$path" /tmp/cover |
NewerOlder