Results 1 to 8 of 8

Thread: Last FM cover art w/ Rhythmbox & Conky

  1. #1
    Join Date
    Dec 2005
    Beans
    697

    Last FM cover art w/ Rhythmbox & Conky

    Almost all of my music listening at home now is through Last FM via Rhythmbox, and I'd love to have Conky display the cover art on my desktop. What I have so far is this script...
    Code:
    #!/bin/bash
    artist=`rhythmbox-client --print-playing-format %aa`
    album=`rhythmbox-client --print-playing-format %at`
    str="`echo "$artist $album" | sed -e s/\\ /+/g`"
    wget `wget "http://www.albumart.org/index.php?srchkey=$str&itempage=1&newsearch=1&searchindex=Music" -q -O - |
    grep "http://www.albumart.org/images/zoom-icon.jpg" -m 1 |
    sed -e 's/" border="0" class="image_border.*//' |
    sed -e 's/.*img src="//'` -q -O /home/hhh/.album
    ...with this .conkyrc...
    Code:
    # maintain spacing between certain elements
    use_spacer yes
    
    # set to yes if you want conky to be forked in the background
    background no
    
    use_xft yes
    
    # Xft font when Xft is enabled
    #xftfont Bitstream Vera Sans Mono-7
    #xftfont Andale Mono-9
    xftfont DejaVu Sans-8
    #xftfont cubicfive10:pixelsize=8
    #xftfont squaredance10:pixelsize=14
    #xftfont swf!t_v02:pixelsize=10
    
    # Text alpha when using Xft
    xftalpha 1
    mail_spool $MAIL
    
    # Update interval in seconds
    update_interval 4.0
    
    # Create own window instead of using desktop (required in nautilus)
    own_window yes
    own_window_transparent yes
    own_window_type desktop
    
    # Use double buffering (reduces flicker, may not work for everyone)
    double_buffer yes
    
    # Minimum size of text area
    minimum_size 250 5
    # Draw shades?
    draw_shades yes
    
    # Draw outlines?
    draw_outline no # amplifies text
    
    # Draw borders around text
    draw_borders no
    
    # Stippled borders?
    stippled_borders 0
    
    # border margins
    border_margin 9
    
    # border width
    border_width 1
    
    # Default colors and also border colors, grey90 == #e5e5e5
    default_color grey90
    default_shade_color black
    default_outline_color DarkGrey
    
    # Text alignment, other possible values are commented
    alignment top_left
    #alignment top_right
    #alignment bottom_left
    #alignment bottom_right
    
    # Gap between borders of screen and text
    gap_x 24
    gap_y 42
    
    # Subtract file system buffers from used memory?
    no_buffers yes
    
    # set to yes if you want all text to be in uppercase
    uppercase no
    
    # stuff after 'TEXT' will be formatted on screen
    
    TEXT
    ${font DejaVu Sans:size=10}${color #a8d82c}${if_running rhythmbox}${exec rhythmbox-client --no-start --print-playing-format %tt}${color #da6e14} by ${color #a8d82c}${exec rhythmbox-client --no-start --print-playing-format %aa}
    ${execi 4 albumart}${image /home/hhh/.album -p 0,25 -s 190x190 -n}
    ${voffset 190}${font DejaVu Sans:size=8}${color #da6e14}from ${color #a8d82c}${exec rhythmbox-client --no-start --print-playing-format %at}
    ${color #da6e14}${exec rhythmbox-client --no-start --print-playing-format %te} / ${exec rhythmbox-client --no-start --print-playing-format %td}$endif
    conkyRhythmbox has to be installed for this to work. The script is named "albumart" and is placed in /bin, I created a blank file in /home/hhh named .album to hold the image, which gives me this...



    Not bad, right? But there are problems...

    1) I'm pulling images from albumart.org, I want to pull the images from Last FM.
    2) I'm fairly consistently getting "wget missing url" errors displayed in Conky, they go away after the next Conky update (4 seconds, in my case).
    3) If there is no cover art available, the last cover art stays there.

    I'm not a programmer, so everything I've managed so far has been from this forum and the CrunchBang! forums (I'm running Openbox standalone/tint2 in Karmic).

    Is anyone else interested in this? Can you help?

    Thanks.
    Last edited by hhh; January 22nd, 2010 at 06:17 AM. Reason: I omitted the conkyRhythmbox dependancy.

  2. #2
    Join Date
    Dec 2005
    Beans
    697

    Re: Last FM cover art w/ Rhythmbox & Conky


  3. #3
    Join Date
    Dec 2005
    Beans
    697

    Re: Last FM cover art w/ Rhythmbox & Conky

    bump

  4. #4
    Join Date
    Feb 2007
    Beans
    94

    Re: Last FM cover art w/ Rhythmbox & Conky

    hhh - did you ever have any joy with this? I love the idea - very cool.

  5. #5
    Join Date
    Dec 2005
    Beans
    697

    Re: Last FM cover art w/ Rhythmbox & Conky

    No. I'm not a programmer, so this was above my head and I couldn't find any interest in it. I don't mind that the album art doesn't always match what Last FM uses, but the error messaqes are unacceptable to me.

  6. #6
    Join Date
    Nov 2009
    Location
    Florida, USA
    Beans
    242
    Distro
    Ubuntu Studio 10.04 Lucid Lynx

    Re: Last FM cover art w/ Rhythmbox & Conky

    i've copied your script and will let you know what i can pull out of it for you.
    Ubuntu User #29918 | Linux User #501271 |

  7. #7
    Join Date
    Dec 2005
    Beans
    697

    Re: Last FM cover art w/ Rhythmbox & Conky

    Thanks!

  8. #8
    Join Date
    Nov 2009
    Location
    Florida, USA
    Beans
    242
    Distro
    Ubuntu Studio 10.04 Lucid Lynx

    Re: Last FM cover art w/ Rhythmbox & Conky

    The only thing I've found wrong with your script is it's very primal. You are mandating the url it searches for and in theory, it works perfectly, given a few circumstances:

    You know or have spelled correctly the artist's name &
    You know or have spelled correctly the album name

    I was watching running this out of the terminal and flipping through songs, when I started getting URL issues with the wget command on songs where the album was unknown or I played a song pulled off a mix cd without proper names.

    So my theory is that when you see issues of album art not showing up, check your artist and album info.
    Ubuntu User #29918 | Linux User #501271 |

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •