Skip to content

Instantly share code, notes, and snippets.

Created January 18, 2015 00:53
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save jasonwryan/0df98a396af89bf82eb6 to your computer and use it in GitHub Desktop.
Repopulate symlinks from udev rule
#!/usr/bin/env bash
# repopulate music links when drive plugged in
shopt -s nullglob
export DISPLAY=:0
export XAUTHORITY=/home/jason/.Xauthority
find /home/jason/Music -type l -exec rm {} \;
for dirs in "${music[@]}"; do
ln -s "$dirs" /home/jason/Music/ 2>/dev/null
mpc update &>/dev/null
if [[ "$status1" -eq 0 && "$status2" -eq 0 ]]; then
printf "%s\n" "Music directory updated" | dzen2 -p 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment