about summary refs log blame commit diff stats
path: root/sys/nixpkgs/pkgs/scripts/source/wrappers/mpc-fav.sh
blob: 795a48755b0a382ee5a338a117800c80bfc31f79 (plain) (tree)
1
2
3
4
5
6
7
8
9

                             
                                                   
 
                                             
 
                                          
 
                                               
 
                                                                           
 
          
            
#!/usr/bin/env dash

# shellcheck source=/dev/null
SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH

FAV_DIR="$XDG_MUSIC_DIR/playlists/favourites"

cd "$XDG_MUSIC_DIR" || die "No music dir!"

[ -d "$FAV_DIR" ] || mkdir --parents "$FAV_DIR"

ln -sr "$(mpc --format '%file%' current)" "$FAV_DIR/" || die "Link failed!"

mpc update

# vim: ft=sh