javascript API for setting up interface defaults

Sebastian Kügler sebas at
Fri Sep 2 08:38:18 UTC 2011

On Thursday, September 01, 2011 16:33:42 Aaron J. Seigo wrote:
>   On Thursday, September 1, 2011 00:14:46 Sebastian Kügler wrote:
> > The same might be useful for having Recommendations at first start, and
> that's a very good point. i'll add that to the requirements...
> > scripted templates for new activities.
> yes, this ends up coming nearly for free with these javascript bits. could
> be  a very nice addition for PA2

Indeed, came up in me as well.

For starters, if the "add stuff to Nepomuk" would do the following, that would 
be quite neat:

Activity.addBookmark("", "Get Help");
Activity.addApp("active-webbrowser"); // name of .desktop file
Activity.addWidget("org.kde.sebaslovesyou", "with a bunch of args));

and possibly:

Activity.rateResource("", 7); // for sorting kicks

This should work for items that are not yet in the Nepomuk database, so on 
first run, we know for sure that some items are created, even before the 
filesystem-based indexer had its full run, which might be quite late given 
that indexing doesn't happen on battery and only when idle.

Not sure how much control we need over the layout, for example "Make the 
bookmarks box 3 cells wide" or stuff like that, might be something for a 
second run over the API.

> > Why not re-use the scripting pieces from workspace? Putting them in a
> > shared
> the re-usable code tends to end up being a smaller % of the total, and its 
> code that literally never changes. the rest of the code is far easier to
> do  "one-off" implementations of rather than trying to make it ever more
> generic which only makes the code ever more complex.
> thus far, every time i've done one of these, i've written the JS runtime
> stuff  once and then only ever come back to add features specific to the
> target shell.
> iow, it's less devel time and we don't get the overhead of yet another
> shared  lib.

OK, makes sense. Thanks for the explanation. :)

sebas | | GPG Key ID: 9119 0EF9

More information about the Active mailing list