[Kde-kiosk] Kiosktool Wishlist: Set profile based on environment variable.

Martijn Klingens klingens at kde.org
Thu Sep 9 23:46:15 CEST 2004


On Thursday 09 September 2004 09:51, Erik Forsberg wrote:
> I have a wish list item for Kiosk tool - I'd like to set profiles for
> a user based on an environment variable, as an additional way to
> determine profile besides setting it per user och per group.
>
> This would be useful in situtations where a user is presented with
> several choices at login, for example a "low bandwidth desktop" and a
> "high bandwidth desktop".

(First some side-tracking, read on below if you're in a hurry)

What do you mean with low bandwidth? Low-speed connection to the servers on 
the LAN or only to the internet? Windows clients can automatically detect 
slow links (with thresholds that are configurable through Group Policy) and I 
think it would make far more sense if KDE had some means to do the same.

In the case of internet connectivity it's of course a lot less feasible to 
detect, but in that case I presume the computer's location determines the 
speed, so again it doesn't need to be asked to the user, right?

This really calls for a directory service, be it Novell NDS, Microsoft Active 
Directory or plain LDAP to store network-wide settings. If KDE were to 
support these in a generic way that would be great. I'm wondering what parts 
are actually needed here and how much work it would be. (And whether I'd have 
the time and resources to write it or whether I have to leave it for someone 
else.)

(Back to your question, this is needed regardless of autodetecting the 
setting, asking the user or fetching from some directory service)

The problem with using environment variables is that they can be overridden by 
a user. Just fire up a shell and execute 'MY_VAR=my_value kdeinit' and all 
newly launched applications (which inherit kdeinit's environment) get the new 
settings. This basically allows a user to break out of the profile.

An alternative that can actually be locked down would be the ability to define 
scripts to be launched. I don't think that is currently possible (Waldo, are 
you listening?), but at least it seems more secure to me. What do you think?

> I don't know how hard this would be to implement? I guess the profile
> selection is done by KDE itself, not by kiosktool?

Yes, it's basically done in the KConfig class (and its parents like 
KConfigBase). You could always patch the code, but for a more generic 
solution I think you're out of luck at least now.

(Unless the $e env expansion works on the profile config, but I somewhat doubt 
it...)

> Could this be accomplished by running a utility that sets KDEDIRS and
> points it at the correct profile? How would that interact with the
> profile selection inside KDE?

That's possible. KDEDIRS is parsed _AFTER_ the normal profile, so instead of 
using a different profile you're basically using TWO profiles at the same 
time. In practice this usually means you have to use $KDEDIRS exclusively and 
not use profiles. The above warning about the environment being overridable 
however holds true here.

Martijn


More information about the kde-kiosk mailing list