guest@dotshare [~/groups/mpd/ncmpcpp] $ ls my-configs-plus-a-script-i-use-for-album-art/ | cat

my configs, plus a script i use for album art (scrot)

wailord Feb 21, 2014 (mpd/ncmpcpp)

ncmpcpp_config(raw, dl)

SCROT

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
mpd_music_dir = "/home/hoeruo/music/"
mpd_communication_mode = "notifications"
now_playing_prefix = "―― "
external_editor = "vim"
use_console_editor = "yes"
cyclic_scrolling = yes
progressbar_look = "―― "
header_visibility = no
statusbar_visibility = no
titles_visibility = no
song_list_format = "{$2%t} $R $3 %b {$9- %a}"
song_status_format = "$5%t on %b by %a"
playlist_disable_highlight_delay = "1"
color1 = "default"
color2 = "cyan"
main_window_color = "light_blue"
main_window_highlight_color = "magenta"
execute_on_song_change = "echo $(echo /home/hoeruo/music/$(mpc current -f %file%)|sed 's_\(.*\)/\(.*\)/\(.*\)_\1/\2/_') > /home/hoeruo/current_music"

CLICK TO VIEW

x

the_now_playing_script(raw, dl)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
#echo $(echo /home/hoeruo/music/$(mpc current -f %file%)|sed 's_\(.*\)/\(.*\)/\(.*\)_\1/\2/_')
#ART=$(echo /home/hoeruo/music/$(mpc current -f %file%)|sed 's_\(.*\)/\(.*\)/\(.*\)_\1/\2/_')
SHOWN=0
while true; do
echo check
if [ "$(cat /home/hoeruo/current_music)" != "$SHOWN" ]; then
pkill feh;
echo killed feh
feh -Z -g 100x100+1500+30 -^ art "$(cat /home/hoeruo/current_music)" &
SHOWN=$(cat /home/hoeruo/current_music)
fi
echo sleeping
sleep 5s;
echo slept
done
 

x

Notes

my ncmpcpp script, the execute_on_song_change was basically anshin’s hard work (the sed), this echos the full path of the currently playing song, minus the song itself, into a file, which i then have feh read and then feh searches the dir to find the artwork
not sure what happens if there’s multiple images, but whatever

NOTE: you can also avoid the pain of a constantly open ncmpcpp with a longer now playing script, by checking the mpc current -f %album%, setting it as a var, and checking for change, then doing the same but removing the sed thingy from the ncmpcpp config
i have it with ncmpcpp, because that uses less resources, and i keep ncmpcpp open whenever i’m listening to music
if you like to keep it closed, by all means make those modifications