Re: Feedback: Six Nautilus annoyances



On Tue, 10 Feb 2004 13:12:04 -0800, Eugenia Loli-Queru wrote:
> I c. However, this doesn't help me too much when I have, let's say, a
> complex launching script for limewire and when I create a nautilus/gnome
> launcher out of it and doesn't work. Editing such a huge script (about 6 KB)
> and give it absolute pathnames (or PREFIX set to ~) in order to work with
> nautilus is not an option IMHO. I am not sure what to be done about this...

The basic problem here is that most "where am i" scripts I've seen are broken in some form or another, in that they try and determine an absolute path to themselves by using the shell, which afaik just isn't possible to do reliably.

There's an easy way to fix this, use autopackages binreloc code.

In the case of LimeWire of course it's written in java which means that won't work quite as nicely, you'd need a wrapper C app that does something like:

#include <prefix.h>
int main(int argc, char *argv[]) {
	char *location = SELFPATH;
	/* do classpath-fu */
	char *cmd = g_strdup_printf("java org.limewire.Whatever --path=%s", location);
	system(cmd);
	free(cmd);	
}

Obviously very roughly done, but you get the idea. I think that's the right way to solve this problem. You don't want evilness like Dungeon Keeper which expects to be run from Explorer and actually crashes if you run it like "keeper" from the command line!

thanks -mike





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