KDE Developer
|
Hi al!
Is it possible to write a plasmoid for amarok in python, ruby or other scripted languages? |
KDE Developer
|
Not yet. In the future it might be possible to write Amarok plasmoids with QtScript (JavaScript), by using our internal scripting system.
http://amarok.kde.org/wiki/Development/ ... _HowTo_2.0
--
Mark Kretschmann - Amarok Developer |
KDE Developer
|
Seems like when we use the system libplasma (which we'll do in Amarok 2.1 likely) there shouldn't be any problem using scripted plasmoids, using the scripting apis already developed by the Plasma project.
Amarok Developer
|
KDE Developer
|
Actually was talking to our plasma dude (lfranchi) he said it might be possible already. No one has tried, so none of us really know what we're talking about.
Amarok Developer
|
KDE Developer
|
i could try. is the tutorial on techbase useful for amarok too?
|
KDE Developer
|
We don't know. Sounds like a good place to start.
Amarok Developer
|
KDE Developer
|
following http://techbase.kde.org/Development/Tutorials/Plasma/RubyApplet i started creating a dummy .desktop file like it is said there, modifing "Plasma/Applet" with "AmarokContext/Applet"
i called it amarok-context-ruby-applet-web.desktop and i put it in `kde4-config --prefix`/share/kde4/services/ but amarok didn't seem to notice the it. it isn't shown in the list of amarok applets. i tried to rename it amarok-context-applet-web.desktop but nothing changed. is there a thing like kbuildsyscoca4 (which i launched) i should call? |
KDE Developer
|
Woohoo! I Won!!
Seriously, it wasn't so difficult: I created a package for plasma desktop firstly using this tutorial: http://techbase.kde.org/Development/Tutorials/Plasma/Python/GettingStarted and I installed it. Then I copied the metadata.desktop in /usr/share/kde4/services, I renamed it "amarok-context-python-applet-something.desktop" and I modified it a bit:
I ran kbuildsyscoca4, restarted amarok and in the little menu i found the Battery Graph entry. One click and I saw python greeting me! |
KDE Developer
|
dude, awesome
i was hoping it would be that easy... seems like it'll be enough to tweak a few things and add a GHNS fetcher. also, this may or may not break completely as we use the libplasma from kdelibs. but it shouldn't get any more complicated. anyway, awesome work
Amarok developer.
lfranchi, proud to be a member of KDE forums since 2008-Oct. |
KDE Developer
|
i'm able to get infos through the amarok dataengines, but how can i do something(e.g. set the rating) ?
i'd need to include in the script the amarok engine class, but is it possible? |
KDE Developer
|
Amarok plasmoids link to libamarok so they can cheat. Its possible that you can't. So this is an actual justification to use DataEngines.
Amarok Developer
|
KDE Developer
|
yes, but with the dataengines i can only get information, i can't set anything. or am i wrong? |
KDE Developer
|
I installed amarok from svn revision 922309, and after restarting it i couldn't find anymore the entry in the applets list. has something changed?
|
KDE Developer
|
i got it.
i had to set the ServiceTypes=Plasma/Applet. i suppose this is caused by the linking to kdelibs' plasma, right? |
KDE Developer
|
hey, so i looked into the whole scripted plasmoid thing at tokamak this weekend. sadly i can't get either the python or the ruby plasma scriptengines to work, so it has seriously hampered my ability to work on this
but anyway, i added a (commented out right now) "Install Applet" button in the Add Applets menu that prompts for a filename to a plasmoid. you tell it the path and it automagically installs it. then it shows up in the list like any other applet. if you want to show it you can uncomment line 315-316 in src/context/widgets/ToolBoxMenu.cpp i'll keep on looking into it as i have time and try to get a scripted engine to work for me. oh, and we now have a kde-apps feed for amarok scripted applets (so we can do a GHNS widget). leo
Amarok developer.
lfranchi, proud to be a member of KDE forums since 2008-Oct. |
Registered users: bancha, Bing [Bot], daret, Evergrowing, Google [Bot], lockheed, sandyvee, Sogou [Bot]