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

2013-06-05 Thread Stephen Dowdy
Aaron J. Seigo wrote, On 06/05/2013 06:06 AM:
> On Tuesday, June 4, 2013 20:38:45 Stephen Dowdy wrote:

>> 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);

Hrmm, i get:

  Error: TypeError: Result of expression 'clock.writeEntry' [undefined] is not 
a function

That's for KDE 4.8.4 (Debian Wheezy)
applicationVersion=0.4
platformVersion=4.8.4(4.8.4)
scriptingVersion=4


>> 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.
(from following e-mail...)
> no, there isn't, and yes, it would be nice.
i've added this to the plasma desktop scripting for 4.11. enjoy

Zow! that was fast!  Unfortunately (for me), we deploy Debian,
so i'll see that in 2 years ;}  It's still something that is
a powerful/helpful addition, so thanks for adding it.

In general, i guess i still have to figure out the best place
to wedge in auxiliary configuration bits that aren't handled
in the plasmascript arena to create the default-site/custom
activity+panel layouts (and other configuration file bits).

'startkde' refers to what appears to be a totally undocumented
  (# see kstartupconfig source for usage (sigh) )
command 'kstartupconfig4' which appears to be a failsafe
baseline/startup setup (as the conf files seem to be hardcode
force-generated every time in 'startkde')
So, that seems to be less designed for site-customization and
more for "stability" assurance?


libpath=`kde4-config --path lib | tr : '\n'`
for prefix in `echo "$libpath" | sed -n -e 's,/lib[^/]*/,/env/,p'`; do
  for file in "$prefix"*.sh; do
test -r "$file" && . "$file"
  done
done

That looks like i could put stuff in /usr/env/foo.sh to check for FirstRun
and configure, but that seems pretty ugly.

I'm also reluctant to modify 'startkde'

Perhaps a .desktop file in /etc/xdg/autostart with an Exec= to run a script?
(that's still pretty ugly)

--stephen
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


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

2013-06-05 Thread Aaron J. Seigo
Aaron J. SeigoOn Wednesday, June 5, 2013 14:49:25  wrote:
> Aaron J. SeigoOn Wednesday, June 5, 2013 14:06:35  wrote:
> > > 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.
> 
> i've added this to the plasma desktop scripting for 4.11. enjoy :)

documented here:

http://techbase.kde.org/KDE_System_Administration/PlasmaDesktopScripting#External_Configuration_Files

also ported to plasma-shell in plasma worskpaces 2.

fixed memory leaks in plasma-mobile, from whence i stole this code. ;)

-- 
Aaron J. Seigo

signature.asc
Description: This is a digitally signed message part.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


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

2013-06-05 Thread Aaron J. Seigo
Aaron J. SeigoOn Wednesday, June 5, 2013 14:06:35  wrote:
> > 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.

i've added this to the plasma desktop scripting for 4.11. enjoy :)

-- 
Aaron J. Seigo

signature.asc
Description: This is a digitally signed message part.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


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

2013-06-05 Thread Aaron J. Seigo
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

signature.asc
Description: This is a digitally signed message part.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


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

2013-06-04 Thread Stephen Dowdy

(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?



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')

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).

There seems to be no generalized "kwriteconfig/kreadconfig" type
interface in PDS (which would be great), so best i can guess i'd
have to script this stuff up some other way.

So, my question would be how best to leverage the existing PDS
layout-templates + plasma-desktop/init structure with some auxiliary
tools?


Thanks,
--stephen

-- 
Stephen Dowdy  -  Systems Administrator  -  NCAR/RAL
303.497.2869   -  sdo...@ucar.edu-  http://www.ral.ucar.edu/~sdowdy/

___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel