[Kde-kiosk] KDE File Associations / Star Office

Waldo Bastian kde-kiosk@mail.kde.org
Thu, 28 Mar 2002 11:11:40 -0800


On Thursday 28 March 2002 02:18 am, Martijn Klingens wrote:
> On Wednesday 27 March 2002 22:49, Janyne Kizer wrote:
> > I think that I have the StarOffice 5.2 setup working properly from
> > /etc/skel.  Basically, I set up a new test id and used the StarOffice
> > mini-install as usual.  Then I copied the ~/office52 directory and th=
e
> > ~/.sversionrc file to /etc/skel.  The two tricky parts are:
> >
> > .sversionrc is user specific.  (~ doesn't work)
> > [Versions]
> > StarOffice 5.2=3D/home/$USERID/office52
> >
> > If this file isn't right and you run soffice, it will start the
> > mini-install.
>
> The only two ways to avoid that which I can think of now are to run a s=
mall
> script upon user creation or login to make sure that entry is correct, =
or
> to make the StarOffice .desktop file run a small shell script that does=
 the
> check before starting soffice.
>
> Waldo, is there a way to make certain apps or scripts run upon the firs=
t
> KDE login? That would be an excellent place to post-process little thin=
gs
> like these...

Yes there is. (Lauri, are you listening? :-)

You can run applications upon every KDE start, or you can run e.g. a scri=
pt=20
once.

1) Automatically running an application on KDE start

By placing a desktop file under share/autostart (either under $KDEHOME or=
=20
under $KDEDIR) the application described by this desktop file will be=20
automatically started when KDE starts. There are some extra fields that y=
ou=20
can define to control when exactly the application should be started. The=
re=20
is also a possibility to make the start of the application conditional.

X-KDE-autostart-phase=3D1

This field describes the phase in which the application should be started=
=2E=20
There are currently two phases defined:
1 - before applications that are part of the session are restored by the=20
session manager.
2 - after applications that are part of the session are restored by the=20
session manager.

The default is 1. If an application is auto-started but can also be part =
of=20
the session, you typically want to have it in phase 2, that way the=20
application that gets auto-started can detect that it has already been=20
restored by the session manager and exit.

X-KDE-autostart-condition=3Dkalarmdrc:General:Autostart:true

This field makes the auto-start of the application condtional. In this ex=
ample=20
the application is only started if the config file "kalarmdrc" has the ke=
y=20
"Autostart" in the "General" group set to true. The value "true" at the e=
nd=20
of the line is used as default value if the key or config file is not=20
present.=20

X-KDE-autostart-after=3Dpanel

This field can be used to control when an application should be autostart=
ed.=20
It refers to the name of another desktop-file in the autostart directory.=
 In=20
this example the application will be started after the panel (kicker) has=
=20
been started. This is usefull for e.g. applications that dock into the pa=
nel.

(See also kdelibs/kinit/README.autostart)

2) Automatically running a script once.

Since KDE 2.2 the "kconf_update" upgrade utility is part of KDE. Although=
=20
intended for updating configuration files between version upgrades it can=
=20
also be used for making sure that an arbitrary program or script is run=20
exactly once for each user.

To do so you need to create a so called update-file and a script and inst=
all=20
both into $KDEDIR/share/apps/kconf_update/ The update script should have=20
".upd" as extension and should contain the following:

Id=3D<someid>
File=3Ddummy
Script=3D<your script>

A single update-file can have multiple of the above sections. The Id is u=
sed=20
to keep track which sections have already been executed once. Each sectio=
n=20
should have a unique Id. Script is the script or application that gets=20
executed. The script should not produce any output because that may other=
wise=20
end up in a configuration file called dummy :-)

kconf_update is executed automatically by kded upon start of KDE and when=
ever=20
new update files are installed.

The configuration file kconf_updaterc keeps track of which update scripts=
 and=20
which sections have already been executed once.

(See also kdelibs/kconf_update/README.kconf_update)

--=20
bastian@kde.org  |   SuSE Labs KDE Developer  |  bastian@suse.com