Skip to content

Instantly share code, notes, and snippets.

View mrMustacho's full-sized avatar

Alejandro Mardones mrMustacho

  • Management Solutions
View GitHub Profile
#!/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}")"
#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
typedef struct node{
int data;
struct node* next;
} node;