added a now playing applet, will be the simplest way to test services

svn path=/trunk/KDE/kdebase/workspace/plasma/scriptengines/javascript/; revision=906016
This commit is contained in:
Marco Martin 2009-01-05 12:53:01 +00:00
parent d86e988bc6
commit a78c297a30
2 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,14 @@
plasmoid.dataUpdate = function(a, b)
{
for ( var i in b ) {
print(i + ' -> ' + b[i] );
}
label.text = "Playing " + b.Title + " by " + b.Artist + ". time: " +
parseInt(b.Position/60) + ":" + (parseInt(b.Position)%60);
}
layout = new LinearLayout(plasmoid);
label = new Label();
layout.addItem(label);
plasmoid.dataEngine("nowplaying").connectSource("org.mpris.amarok", plasmoid, 500);

View File

@ -0,0 +1,17 @@
[Desktop Entry]
Name=script-nowplaying
Comment=Javascript version current track playing
Icon=configure
Type=Service
X-KDE-ServiceTypes=Plasma/Applet
X-Plasma-MainScript=code/main.js
X-KDE-PluginInfo-Author=Marco Martin
X-KDE-PluginInfo-Email=notmart@gmail.com
X-KDE-PluginInfo-Name=script-nowplaying
X-KDE-PluginInfo-Version=0.0
X-KDE-PluginInfo-Website=http://plasma.kde.org/
X-KDE-PluginInfo-Category=Utilities
X-KDE-PluginInfo-Depends=
X-KDE-PluginInfo-License=GPL
X-KDE-PluginInfo-EnabledByDefault=true
X-Plasma-API=javascript