Programmatically adding plasmoid widgets to the plasma panel?
Duncan
1i5t5.duncan at cox.net
Fri Jun 3 05:29:58 BST 2011
Kevin Krammer posted on Thu, 02 Jun 2011 21:33:11 +0200 as excerpted:
> On Thursday, 2011-06-02, Stephen Dowdy wrote:
>> I have hunted around a bit, but not come up with anything i can run
>> with yet, but want to populate the plasma panel with "standard"
>> widgets. Below is a shell script i use on KDE3 to allow user to
>> quickly select some standard widgets to add to 'kicker' panel,
>> but i'd like the equivalent for KDE4. At least i'd like to know how to
>> programmatically install a widget similar to what i'm doing below.
>>
>> Anyway, 'kwriteconfig' is certainly not a viable tool to manipulate
>> either KDE3's kicker panel config file, nor the plasma config file
>> (that one's even more horrific requiring a full parse to figure out
>> indexes of multi-variant arrays, blah...)
>>
>> I ran across some cursory ECMAscript docs for plasma, and if that's the
>> way to go, any example code anybody's got is welcome.
>>
>> Anyway, any pointers appreciated.
>
> Best source for answers on this level is probably the plasma-devel
> mailinglist.
That's definitely true, but here's some info to get started with...
I from 4.6 at least (maybe 4.5 IDR), the plasma panel setup is fully
scriptable. I recall reading blogs about it. FWIW I believe the
native scripting language is javascript.
In kde 4.6, with widgets unlocked, if you context click (or use the
cashew/toolbox) and select new panel, there are now several entries
including one for default panel. IIRC according to that blog entry, users
were frequently deleting their panel and then figuring out how to add a new
panel, but it was empty and they had to add back all the default items,
pretty hard when you don't remember what they were and you're just a
normal user that doesn't really understand what's going on in the first
place, and thus is rather intimidated by it all! They had already planned
the scripting feature, tho, so after that was committed all they needed
was a script to bring back the default panel. =:^)
Taking a look at the package (plasma-workspace, here on Gentoo) list of
system files, it appears that the templates are in
/usr/share/apps/plasma/layout-templates/ Browse that (or your distros
equivalent) a bit and you can probably figure out the basics.
Let's see if I have similar good luck with google...
OK, here's the blog I was remembering...
http://aseigo.blogspot.com/2010/04/solving-little-problem-with-slightly.html
... and here's a google search that should get you (OP) started on more
(the techbase link should be useful, at first I was getting a bunch of
plasma-tv and etc. hits I had to screen out thus the -word bits)...
http://www.google.com/search?q=plasma+panel+script+-flat+-tv+-theater&hl=en&num=10&lr=&ft=i&cr=&safe=images&tbs=#sclient=psy&hl=en&lr=&source=hp&q=kde+plasma+panel+script+default+-flat+-tv+-theater&aq=f&aqi=&aql=&oq=&pbx=1&bav=on.2,or.r_gc.r_pw.&fp=376cf53bf65d1173&biw=952&bih=892
If that's not enough, then as Kevin suggests, the plasma-devel
list is probably your best bet.
--
Duncan - List replies preferred. No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master." Richard Stallman
___________________________________________________
This message is from the kde mailing list.
Account management: https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.
More information about the kde
mailing list