autostart/session interaction and auto-"cleanup"

Brian J. Tarricone bjt23 at cornell.edu
Sat Oct 18 21:59:24 CEST 2008


Hey guys,

What do we think about having xfce4-session attempt to automatically
deal with duplicate app in both autostart and the session?

This is a little dicey, because the SmProgram SM property can be just
about anything (and need not be the app's binary name or WM class name
or whatever), and SmResartCommand will often have state-related
arguments in it and thus won't match the autostart's Exec= key.
SmCloneCommand may work, and should in theory match with Exec=, but
it's possible that the property might be missing (the spec says it's
required, but xfce4-session appears to be a bit more lax and will work
without it).  And it's also possible (however unlikely) that that
wouldn't even match Exec=.

Anyhow, my proposal would be this:

On logout, if the user has opted to save his/her session, we build a
list of apps launched via XDG autostart.  As we save each app in the
session, we check to see if it's also in the autostart list.  If so, we
remove it by appending Hidden=true to the .desktop file (or by creating
one with only that key), plus perhaps a comment such as "# disabled by
xfce4-session to prevent duplicates".

Extra credit:

The autostart editor could also be modified to understand this and
warn the user if they attempt to re-enable it.  If the user insists on
re-enabling it, it should mark something in the .desktop file so
xfce4-session exempts this app from the auto-cleanup on session save.

Of course... this would require yet another exception to feature
freeze :-/ .

Thoughts?

	-b

P.S.  Long-term, it might be nice to get this into fd.o.  We could
standardize on a new SM property such as "DesktopID" which would
contain the autostart .desktop name to make matching always correct.
Then apps could actually rely on this mechanism to handle automatic
initial start via XDG autostart, and then rely on session management
moving forward, without worrying about duplicates.



More information about the Xfce4-dev mailing list