Q: PlasmaDesktopScripting : Sizing widget PopUps in Panels, best methods of handling some tasks

Aaron J. Seigo aseigo at kde.org
Wed Jun 5 12:06:35 UTC 2013


On Tuesday, June 4, 2013 20:38:45 Stephen Dowdy wrote:
> (AFAICT, 'plasma-devel' is the only mailing list this
> question might apply, but please let me know if i should
> pursue assistance somewhere else)
> 
> 
> I'm attempting to construct a default new-user setup via:
> 
>     $(kde4-config --install data)/plasma-desktop/init/99-SITEDEFAULT.js
> 
> that loads a panel template from .../plasma/layout-templates/site-layout/...
> (first wiping all existing panels&activities created by 00-Default. This
> seems the best way to not conflict with my distribution's
> (Debian Wheezy) ownership of files)
> 
> I'm not really wanting to use a "skel" homedir splatting technique
> (populating ~/.kde/... with hardcoded setups) as this leads to
> inconsistencies with screensizes, etc, so PlasmaDesktop Scripting
> looked to be a great tool for managing user account configurations.
> 
> 
> Q1: Is it possible in PlasmaDesktopScripting (PDS) to set the size
> (HxW) of the Popup for a widget loaded in the panel?
> 
> e.g.
>    var clock = panel.addWidget("digital-clock")
>    clock.writeConfig("dateStyle", "4") // ISO date
> 
> I find the default Popup size displaying the calendar and
> "events/holidays" to be too small (both height and width).
> writeConfig() and writeGlobalConfig() create Group labels not used
> for the PopUp group labels. (addition of [Configuration] and
> [AppletGlobals]' that aren't in the '[PopupApplet]' label)
> 
> Any way to do that in the plasma-desktop/init/* + plasma/layout-templates/*
> toolkit?

yes.. it is not well documented, but you can do it with:

clock.currentConfigGroup = ['PopupApplet'];
clock.writeEntry('DialogHeight', 228);
clock.writeEntry('DialogWidth', 408);


> Q2:  How best to handle situations where a PDS interface is only partially
>     managed, something like:
> 
>     var pager = panel.addWidget("pager")
> 
> Where I want to set pager to 2x2. Even the info from the System
> Adminstrator PDS document implies that:
> 
>     pager.writeGlobalConfig("rows", "2")
> 
> Should set the rows to 2, but the default pager is only 1 desktop (1x1)
> 
> There seems to be no interface to change this, and what makes it
> worse is that this seems to only be a visual interface to properties
> managed by KWin (kwinrc [Desktops] keys 'Number' and 'Rows')

yes, this moved to kwin and is no longer managed by the plasmoid. this means 
adjusting the defaults in kwinrc.

> Also, for 'kickoff', i'd like to run through my ".desktop" locator function
> (finding various apps by alternate names, to generalize our deployment
> of laptops and desktops that find things in different places or
> by install), building a Favorite_URLs and then stuff that into
> 'kickoff's Favorites listing.  but PDS seems to only manage
> groups/keys within 'plasma-desktop-appletsrc', and kickoff uses
> a global .kickoffrc (ignoring what's set in p-d-appletsrc).

yes, kickoff is pretty broken in this regard. it ought to be using the 
globalConfigGroup but instead it uses a kickoffrc. seems this happened in 2009, 
perhaps before there was support for such a thing.

the only way to fix this, really, would be to create a migration path in the 
code from kickoffrc to globalConfig()

> There seems to be no generalized "kwriteconfig/kreadconfig" type
> interface in PDS (which would be great), so best i can guess i'd

no, there isn't, and yes, it would be nice.

something like the bindings in plasma-mobile/components/settings/configgroup.h 
(though those are for QML, it would be the same thing essentially for qscript) 
would be nice.

-- 
Aaron J. Seigo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20130605/3ec0d5ed/attachment.sig>


More information about the Plasma-devel mailing list