Skip to content

Instantly share code, notes, and snippets.

View bonelifer's full-sized avatar

William Jacoby bonelifer

View GitHub Profile
@bonelifer
bonelifer / dashy_to_homepage.py
Last active April 2, 2025 01:51 — forked from Nixellion/dashy_to_homepage.py
Script to migrate from Dashy (https://dashy.to/) to Homepage (https://gethomepage.dev/)
"""
Script to migrate from Dashy (https://dashy.to/) to Homepage (https://gethomepage.dev/)
Get your config.yml from Dashy and place it in the same folder as this script.
Run the script with Python.
The script takes a list of known services that have Widgets in Dashy and tries to automatically match your existing entries to this list, to decide whether an entry should be a bookmark or a service entry.
Adjust MATCH_THRESHOLD as needed depending on how much your titles match service names.
"""
#!/usr/bin/env bash
lidarrUrl=""
lidarrApiKey=""
curl -s "$lidarrUrl/api/v1/album/monitor" --request PUT --header "X-Api-Key:"${lidarrApiKey} -H "Content-Type: application/json" --data-raw '{"albumIds":['$lidarr_album_id'], "monitored": false}'
@bonelifer
bonelifer / ytmusic.py
Last active April 1, 2025 23:18
Script to Fetch MusicBrainz IDs (MBIDs) for Artists from a CSV File
#!/usr/bin/env python3
"""
Script to Fetch MusicBrainz IDs (MBIDs) for Artists from a CSV File
Purpose:
This script reads a CSV file containing artist names, extracts unique artist names
from the columns 'Artist Name 1' to 'Artist Name 6', and queries the MusicBrainz API
for the MusicBrainz ID (MBID) of each artist. It then saves the results to a JSON file.
Steps:
@bonelifer
bonelifer / somafm-mpd-playlists.sh
Last active January 26, 2025 19:06 — forked from SydLambert/somafm-mpd-playlists.sh
Add SomaFM channels as individual playlists in specified directories. Supports multiple playlist types (highestpls-aac, fastpls-mp3, fastpls-aacp, slowpls-aacp). Will delete existing playlists before creating new ones. Requires curl, awk, grep, and basic shell tools. You can specify which playlist types to create by passing arguments, or leave b…
#!/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
#!/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() {
@bonelifer
bonelifer / mpc-guardian.sh
Last active January 26, 2025 06:23 — forked from moopet/mpc-guardian.sh
With a shared MPD server, sometimes other people will add shit music. Stop the rot. Also watch Christmas genre and limit it to specific date range.
#!/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
@bonelifer
bonelifer / mpd_delete_duplicates.sh
Created January 26, 2025 05:56 — forked from hiqua/mpd_delete_duplicates.sh
Delete duplicates from mpd playlist
#!/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.
#!/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}")"
#!/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.
@bonelifer
bonelifer / mpc-control.sh
Created January 26, 2025 05:11 — forked from kenanpelit/gist:e5eea8618a813ac20da3cbffafcb9556
mpc-control - full function
#!/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="󰝝"