[g-a-devel] autostart desktop files



At the GNOME Accessibility Summit in Boston, the question was asked how
to autostart .desktop files.  Here are my notes that I promised to
forward.

"The GNOME 2.14 offers a way for developers to register their
applications  to be started up automatically when GNOME starts. To do
this, you only need  to install a .desktop file in
$prefix/share/gnome/autostart/,  /etc/xdg/autostart/ or
~/.config/autostart/.  If you want to install a  service, but disable it
by default, you can add the property  X-GNOME-autostart-enabled =
False."

"There are some caveats to registering services in this way:

* Applications that register themselves with the session in some other 
  way (e.g. nautilus, gnome-panel, vino) should not also register 
  themselves in this way.
* Session managed applications will not be handled cleanly, so ensure 
  that you pass the --sm-disable flag on your Exec line."

http://www.gnome.org/start/2.14/notes/en/rndevelopers.html

To install a ".desktop" file into the application directory, then use
the desktop-file-install command from the desktop-file-utils package.

#!/bin/sh
#
# Install ".desktop" files for GNOME and/or KDE.
#

desktop-file-validate $1 || exit $?

DESKTOP=gnome
VENDOR=${VENDOR:-gnome}
PREFIX=${PREFIX:-/usr}

if [ $(id -u) -ne 0 ]; then
	BASEDIR=$HOME/.config
	DESKTOP=
else
	BASEDIR=$PREFIX/share
fi

grep X-GNOME-autostart-enabled $1 > /dev/null 2>&1
if [ $? -eq 0 ]; then
	DESTDIR=$BASEDIR/$DESKTOP/autostart
else
	DESTDIR=$BASEDIR/$DESKTOP/applications
fi

cp $1 /usr/tmp

desktop-file-install --vendor $VENDOR --delete-original \
	--dir $DESTDIR  $1

ls -las $DESTDIR/$VENDOR-$1

#EOF

http://manpages.debian.net/cgi-bin/display_man.cgi?id=5309022b1aa1922fa3360443fb9fb3b3&format=html


-- 

George (gk4)




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]