mpd & ncmpcpp about new versions

Forum Forums General Software mpd & ncmpcpp about new versions

  • This topic has 15 replies, 4 voices, and was last updated Jan 26-2:08 am by ex_Koo.
Viewing 16 post (of 16 total)
  • Author
    Posts
  • #50835
    Member
    ex_Koo
      Helpful
      Up
      0
      ::

      @userzero

      kunst is good if you like the album art outside the player. But on testing a while ago we found it can’t handle embedded art very well. Please keep adding ideas.

      One can use w3m & w3m-ing which works good too but, I prefer to use Ueberzug

      This is a typical w3m albumart script. Added to the config execute_on_song_change= “~/.ncmpcpp/art.sh”

      #!/bin/bash
      
      #put this file to ~/.ncmpcpp/ and name it art.sh or what ever you want. Make executable
      
      MUSIC_DIR=/var/lib/mpd/music/ #path to your music dir
      
      COVER=/tmp/cover.png
      
      function reset_background
      {
          printf "\e]20;100x100+1000+1000\a"
      }
      
      {
          album="$(mpc --format %album% current)"
          file="$(mpc --format %file% current)"
          album_dir="${file%/*}"
          [[ -z "$album_dir" ]] && exit 1
          album_dir="$MUSIC_DIR/$album_dir"
      
          covers="$(find "$album_dir" -type d -exec find {} -maxdepth 1 -type f -iregex ".*/.*\(${album}\|cover\|folder\|artwork\|front\).*[.]\(jpe?g\|png\|gif\|bmp\)" \; )"
          src="$(echo -n "$covers" | head -n1)"
          rm -f "$COVER" 
          if [[ -n "$src" ]] ; then
              #resize the image's width to 300px 
              convert "$src" -resize 300x "$COVER"
          if [[ -f "$COVER" ]] ; then
                 #scale down the cover to 30% of the original
                 printf "\e]20;${COVER};30x30+50+95:op=keep-aspect\a"
                
                else
                  reset_background
              fi
               else
                  reset_background
              fi
      } &
       
    Viewing 16 post (of 16 total)
    • You must be logged in to reply to this topic.