Write to AppletGlobals in plasma-desktop-appletsrc with Javascript

Antony Loebs barefootedjournalist at gmail.com
Sun Apr 25 21:56:51 CEST 2010


On Sun, Apr 25, 2010 at 3:08 PM, Aaron J. Seigo <aseigo at kde.org> wrote:

>  currently there isn't any way to do this in 4.4. in 4.5 you will be able
> to use read/writeGlobalConfig to do so.
>
> in any case, the # of rows of the pager is being moved to the window
> manager where it really belongs (to follow the internal layout of virtual
> desktops / viewports according to the WM), so even in this case it probably
> won't work for very much longer.
>

Pity. Would it be possible to brute-force it some other way? For example, at
the beginning of the script, to do something like:
---
var fh = fopen("~/.kde/share/config/plasma-desktop-appletsrc", 3)
fwrite(fh, "[AppletGlobals][plasma_applet_pager]\nrows=1");
fclose(fh);
---
(This doesn't work, btw, since plasma-desktop complains about fopen, but
it's just to make my meaning clear.)

Also, on a somewhat related note, I've discovered that some applets start
too quickly. :) For example, take the example of the quicklaunch applet. In
the script, I have:
---
qlaunch = panel.addWidget("quicklaunch");
qlaunch.writeConfig("iconSize", "24");
qlaunch.writeConfig("iconUrls",
"file:///usr/share/applications/firefox.desktop");
---
However, when quicklaunch starts, it displays the default Konqueror,
Dolphin, and Kopete icons at size 16. If I go back and insert the lines into
plasma-desktop-appletsrc, it works. Additionally, for some applets
(Lancelot, yaWP), I don't have to even edit anything; if I just restart
plasma-desktop, they then display correctly. From this I conclude that it's
a matter of the applets trying to read the configuration file before their
configurations are written. Any suggestions on how to overcome this; perhaps
a way to write the configuration first, and then start the applet?

Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/plasma-devel/attachments/20100425/50b19a07/attachment-0001.htm 


More information about the Plasma-devel mailing list