ksmarttray: first time invocation through menu item?

Pascal Bleser pascal.bleser at skynet.be
Sun Aug 20 08:05:22 PDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Axel Thimm wrote:
> how is ksmarttray supposed to be placed in the user's tray (other than
> firing up a terminal and invoking it there, e.g. in a desktop-gui
> way)?
> 
>   https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=201752
> 
> The suggestion is to use a menu entry in the package, but that is
> neither persistent across sessions, nor the natural way applets are
> 'trayed'.
> 
> I'm no gnome/kde expert, in fact I recently moved away from fvwm ;)
> So perhaps lacking any other mechanisms a menu item does makes sense?

In the smart RPM for SUSE Linux, we include a .desktop files to start
- - smart --gui
- - ksmarttray
both as root, by specifying:
X-KDE-SubstituteUID=true
X-KDE-Username=root
in the .desktop file.
Note that these attributes are also honored on GNOME (usin gnomesu
instead of kdesu).

To automatically start ksmarttray when logging into KDE, one just needs
to put a .desktop file into <KDE_PREFIX>/share/autostart/
On SUSE Linux that's /opt/kde3/share/autostart/

There you can specify some additional attributes, like:
X-KDE-autostart-after=panel
(speaks for itself)
or
X-KDE-UniqueApplet=true
(to always only start one instance of the applet - although ksmarttray
is not a KDE applet :\ - dunno if it works)
or
X-KDE-autostart-condition=ksmarttrayrc:General:Autostart:true

The last one is probably the most interesting, but it would need to add
some code to ksmarttray to prompt the user whether he wants ksmarttray
to be started automatically at login. Usually that's part of the "Quit"
dialog. Then set that property as defined above in
~/.kde/share/config/ksmarttrayrc to false and it won't be started at login.

Note that the ksmarttrayrc file is managed through the KDE configuration
framework.

GNOME has the same mechanism. On SUSE that's in /opt/gnome/share/autostart/
GNOME honors the X-KDE-* properties in .desktop files.

I think ksmarttray should be rewritten as a KDE applet (there's a
request in the tracker about it) and sport a small configuration dialog
to configure the interval at which to run smart-update (would be stored
in ksmarttrayrc).
Also, when you close ksmarttray, prompt the user in the quit dialog
whether he wants ksmarttray to be started when he logs in or not, and
save that preference to ksmarttrayrc.
Last but not least, add the .desktop file in
<KDE_PREFIX>/share/autostart and <GNOME_PREFIX>/share/autostart (or just
one if your distribution uses /usr for both, which is not the case on
SUSE and... Mandriva AFAICR), with the X-KDE-* attributes as explained
above.

I'm not a KDE or GNOME developer, so I can't give any further details,
it's just what I can say about it off the top of my head and by looking
at .desktop files for e.g. networkmanager or beagled.

Maybe looking at the sources of e.g. knetworkmanager and ripping the
necessary code would be easy enough.

cheers
- --
  -o) Pascal Bleser     http://linux01.gwdg.de/~pbleser/
  /\\ <pascal.bleser at skynet.be>       <guru at unixtech.be>
 _\_v The more things change, the more they stay insane.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFE6Hoyr3NMWliFcXcRAiWRAJwI4JpgYW0JjTbkXTdbROUVVhd52wCgp8UY
Tw2RJBDKdHkQmmH/EdAZ5Xo=
=s4q7
-----END PGP SIGNATURE-----



More information about the Smart mailing list