14Jun/08Off
Amarok 1.4.x Now Playing support in Kopete from KDE 4.1
The transition to KDE/Qt 4 also brought the switch from dcop to dbus. Kopete's "Now Playing" plugin lost support for Amarok 1.4.x at the same time. This is a problem for many people, as Amarok 2.0 (which is supported by the Now Playing plugin) is not yet released in a stable version.
Kopete's new (KDE 4.1) Pipes plugin to the rescue! You can setup a simple script to query Amarok via dcop for the currently playing song and have it replace /media calls in messages just like the Now Playing plugin does. To set it up:
- Save the script below somewhere to your computer and make it executable (chmod +x)
- Enable the Pipes plugin in Kopete => Settings => Configure => Plugins
- Open the Pipes plugin configuration window and add the previously saved script for the "Plain Text Message Body" of messages in "Outbound" direction.
Finally, the Now Playing script for the Pipes plugin:
#!/bin/bash
NowPlaying="$(dcop amarok player nowPlaying)"
{ while read line
do
echo "${line}"
done < /dev/stdin; echo "${line}"; } | sed "s@/media@${NowPlaying}@g"
