Autostart (Was: Third-party sessioning requests)

l.lunak at suse.cz l.lunak at suse.cz
Sun Jan 11 01:34:09 EET 2004


Dne Saturday 10 of January 2004 03:02 Ray Strode napsal(a):
> Hi Waldo,
>
> > We have a bunch of such keys in KDE already:
> >
> > X-KDE-autostart-condition: a reference to a configuration entry which
> > value
> > determines whether the application should be started or not. That way you
> > don't need to mess around with .desktop files if you want to
> > enable/disable
> > certain the autostarting of an application from a program. This probably
> > needs some attention if we are going to standardize this.
> >
> > Example:
> > X-KDE-autostart-condition=klipperrc:General:AutoStart:true
> >
> > This looks at $KDEDIR/share/config/klipperrc, looks up the key
> > AutoStart= in
> > the [General] group and assumes "true" if no such key is present.
>
> This one sounds like it probably should remain kde specific.  AFAIK, the
> configuration file format isn't standardized, so this key doesn't make
> much sense standardized either.  Unless I'm wrong?

 See below.

>
> > X-KDE-autostart-after: References another autostarted application by
> > the name
> > of its .desktop file (without the .desktop extension)
>
> This probably would be good, but it's not entirely clear to me how this
> would
> interact with the _DSME_Priority (or whatever this becomes from
> discussion with
> Lubos in the other thread) which clients are going to set when they are
> started.
>
> Also, clients may need to be started after a program with a specific role,
> versus after a program with a specific .desktop file.  We should probably
> add something to cover that too, but then we'll need a new key for
> specifying
> what the role is (like autostart-role=panel or whatever)
>
> Actually I have a broader question for you.  Once a program is started from
> autostart it registers with the session manager and becomes part of the
> user session right?  Then if the user saves session the program is going to
> be recorded in ksmserver's user session file I assume.  So next time the
> user logs
> in, the program is going to be in two places, the session file and
> autostart.
> Is this correct?  How do you prevent it from being started twice?

 Actually that's mostly what the autostart condition is for. Apps started this 
way specify RestartNever for SM, and use the autostart condition to specify 
whether the app should be restarted or not. I've never liked this much (but 
apparently not that much to make me think about something better). This can 
get ever a bit more complicated with the fact that many utilities which I 
believe should be panel applets are systray apps, and even if the user 
decides not to save KDE sessions, they still expect things that are "part" of 
the panel stay in the panel even after KDE restart (if you want to see 
something bizarre, start KDE, quit Klipper from systray, say that you don't 
want it restarted, and later try to find out how to re-add it permanently - 
things like this are the reason why I don't like this way).

 Maybe this could be handled by changing those apps to applets or making them 
use RestartAnyway. I'm not sure if this would solve all cases though, we use 
the condition even for KTip (i.e. whether to show a tip after KDE startup).

 This would of course require that the SM manager reads both its saved session 
and the autostart directory and ignores the apps in the autostart directory 
that are in the saved session. This would also solve the problem how to 
specify what has to be started for the very first time when you have nothing 
at all the session.

> > X-KDE-autostart-phase: We recognize two different phases during startup:
> > 1: After the WM has started but before the rest of the (saved) session
> > has
> > been restored
> > 2: After the (saved) session has been restored
>
> As Lubos pointed out, certain clients (those with the setup role) should be
> started before the window manager.  Maybe instead of having two phases, it
> would be better to just specify the startup orders for the standard roles,
>
> 1) setup
> 2) window manager
> 3) desktop handler
> 4) panel
> 5) desktop component
> 6) normal
>
> Then .desktop files have a number of choices:
>   * They can do nothing at all, which would imply role normal and they
> would be
>     started last (or among the last few started).
>   * They can specify "autostart-role=desktop component", which would get
> them
>     started from the order in the list above.
>   * They can specify "autostart-after-role=window manager" (or whatever)
> and then they would be started after all the clients of a specific role are
> started.  I guess X-KDE-autostart-phase=2 would be
>     "autostart-after-role=normal"
>   * They can specify "autostart-after: kdesktop" (or whatever) and then
> they would be started after a specific other .desktop file is started.

 I think we could use 'autostart-after=<list>', and <list> would contain 
either names 'kwin','kdesktop', etc., or roles/phases, written in some 
special way, let's say '[WM]', '[SESSION]' etc. Apps would simply specify 
everything they need to be started after, I think this could work better than 
numbers.

-- 
 Lubos Lunak
 KDE Developer





More information about the xdg mailing list