View Single Post
  #3 (permalink)  
Old 09-Jul-2009, 10:34
microchip8's Avatar
microchip8 microchip8 is online now
Shaman Penguin
 
Join Date: Jun 2008
Location: /dev/belgium
Posts: 2,194
microchip8 is a reputation jewel in the roughmicrochip8 is a reputation jewel in the roughmicrochip8 is a reputation jewel in the roughmicrochip8 is a reputation jewel in the roughmicrochip8 is a reputation jewel in the rough
Default Re: Shell script, Amarok currently playing.. need some help

Code:
#! /bin/bash
BITRATE="$(qdbus org.kde.amarok /Player GetMetadata | grep bitrate | sed 's/audio-bitrate: //')"
ARTIST="$(qdbus org.kde.amarok /Player GetMetadata | grep artist | sed 's/artist: //')"
ALBUM="$(qdbus org.kde.amarok /Player GetMetadata | grep album | head -n 1 | sed 's/album: //')"
TITLE="$(qdbus org.kde.amarok /Player GetMetadata | grep title | tail -n 1 | sed 's/title: //')"
YEAR="$(qdbus org.kde.amarok /Player GetMetadata | grep year | sed 's/year: //')"
SAMPLERATE="$(qdbus org.kde.amarok /Player GetMetadata | grep audio-samplerate | sed 's/audio-samplerate: //')"

echo -e "np: $ARTIST - $TITLE <$ALBUM ($YEAR)> [$FILETYPE @ $BITRATE kbps | $SAMPLERATE hz ] [$NOW/$TIME]"
Works with Amarok2. You are placing the quotes incorrectly, see correction above
__________________
My site: http://microchip.bplaced.net
My repo: http://download.opensuse.org/repositories/home:/microchip8
SUSE Unbound Forum: http://suseunbound.lefora.com


Do coders dream of sheep() ?
Reply With Quote