Results 1 to 2 of 2

Thread: Amarok 2.4 and Conky (using AWK, help!)

  1. #1
    Join Date
    Oct 2007
    Beans
    34

    Amarok 2.4 and Conky (using AWK, help!)

    Hey all -- this was working under 2.3, but it looks like they threw in AlbumArtist as part of the GetMetaData command in 2.4 .

    Here's all the metadata for a particular track:
    Code:
    album: Summer of Fear
    albumartist: Miles Benjamin Anthony Robinson
    artist: Miles Benjamin Anthony Robinson
    arturl: amarok-sqltrackuid://1480f28de21b8b2a87f4463bc7a2dc16
    audio-bitrate: 261
    audio-samplerate: 44100
    comment: Amazon.com Song ID: 212954979
    genre: Indie
    location: file:///home/chow/Network/Music/Miles%20Benjamin%20Anthony%20Robinson/Summer%20of%20Fear/02%20-%20Always%20an%20Anchor.mp3
    lyrics: "www.lyricsplugin.com"
    
    Upgrade to Lyrics Plugin version 0.4
    mtime: 252000
    rating: 0
    time: 252
    title: Always an Anchor
    tracknumber: 2
    year: 2009
    And my problem is this -- when I awk for the artist: line, I get both the Artist and the AlbumArtist metadata lines. Is there a way to isolate JUST "artist:" and have it ignore/skip "albumartist:"?

    Command:
    Code:
    qdbus org.kde.amarok /Player GetMetadata | awk '/artist:/{print substr($0,9)}' | tr '[A-Z]' '[a-z]'
    Output:
    Code:
    ist: miles benjamin anthony robinson
    miles benjamin anthony robinson
    The first line, as you can see is from the albumartist: entry and the second (correct) line is for the artist: entry. Obviously this is screwing up my once-beautiful conky setup.

    I stole this script from someone ages ago -- and I don't quite understand the intracacies of awk yet.

    Help?

    -Chow

  2. #2
    Join Date
    Jul 2009
    Location
    London
    Beans
    1,480
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Amarok 2.4 and Conky (using AWK, help!)

    Hi,
    change the awk pattern to /^artist:/
    (the ^ anchors the pattern to the start of a line).

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
  •