Cross-desktop helpers

Mark McLoughlin markmc at redhat.com
Fri Dec 10 16:18:14 EET 2004


Hi Hongli,

On Thu, 2004-12-09 at 23:56 +0100, Hongli Lai wrote:
> Alex Graveley wrote:
> > 	* opening a web browser
> 
> It's a bit hacky, but I wrote a script which tries to guess the user's 
> preferred browser, based on the current desktop environment.

> desktop=`detectDesktop`
> if [[ "$desktop" = "gnome" ]] && command -v gnome-open &>/dev/null; then
> 	gnome-open "$1"
> elif [[ "$desktop" = "kde" ]]; then
> 	kfmclient exec "$1"
> elif command -v firefox &>/dev/null; then
> 	firefox "$1"
> elif command -v mozilla &>/dev/null; then
> 	mozilla "$1"
> else
> 	exit 1
> fi

	As hacky as this may be, its not a million miles away from the solution
we converged towards when discussing the $DESKTOP proposal earlier ...

	i.e. have a defined $DESKTOP_LAUNCH env variable, have the session
managers set it to something appropriate and provide a small sample
implementation of using this (be it a shell script, and maybe a small
sample xdglaunch.c).

	The key thing is to tackle each of these problems in such a way that we
don't have every app hardcoding the kind of logic you have in your shell
script.

	But someone who cares about this needs to sit down, write up the spec
and the sample code and iterating through potential problems. First one
I can think of is startup notification ...

Cheers,
Mark.




More information about the xdg mailing list