Re: [Nautilus-list] The script extention to nautilus...



On Wed, 25 Apr 2001, John Sullivan wrote:

> The current support for scripts is very simple. There are no requirements
> put on the scripts at all except (1) they are executable, and (2) they are
> in the Scripts folder. There is no separate file that controls any aspect of
> the scripts (Snaggen might have run into .nautilus-metadata.xml, which
> stores metadata in each Nautilus directory, but has nothing specifically to
> do with scripts). So the scripts can be in any language your computer knows
> how to execute (perl, bash, python, etc.), and passing them around to other
> people requires only sending the script files.
> 
> It would be nice to add support for localization, MIME filtering, etc. It
> would especially be nice to add these in a way that doesn't make creating or
> sharing scripts more difficult.

 Current design can easily be made usable IMO. I think that:
1) Only files with some special extension needs to be treated as scripts.
2) For each script there should be a corresponding metafile with basename
matching the name of the script and special extension, with format 
similar to .desktop file that will specify 
	* localized title of the menuitem
	* localized tooltip of the menuitem
	* name of the icon for the menuitem
	* minimal user level to enable the item for
	* whether script can be used when multiplie files are selected
	* MC-like predicate to active or skip for (skiping is 
		important - for example there can be scripts that are
		meaningful for anything but directory or block device)
		(MC's predicates allow matching by mime type, regex or shell
		glob, but I would recommend to allow logical expressions
 		for such predicates too - OR, AND, NOT).
	* arbitrary shell command that will tell whether the menuitem
		for the script should be shown (but fully explain to the
		script authors that such predicates will slow system)
	* probably category of the script (convertion, viewing, editing, 
		utility) - if category is specified, some format of the name
		can be assumed (e.g. if category is "conversion", then the
		menu title should be the name of format to convert to, so that
		it will be possible to group all menuitems of "convert"
		category in submenu).

 There should be some subdirectory in the ~/ where scripts should also be
scanned for, so that users will be able to extend a set of scripts they could
use.

 Also I'd recommend you to also scan for scripts in the directories with the
following names (of course putting everything in one directory and using
complex shell commands as a predicates can be an alternative, but
performance-unwise, way): 

* specific to encoding of locale (e.g. "utf8") 
* specific to language and country of locale, combined or separate (e.g. "ru",
	"RU", "ru_RU") - just imagine menuitem "Translate to french via
	babelfish" if running Nautilus is running under "fr_FR" locale (such
	script should be put in the "fr" subdirectory)
* specific to desktop environment Nautilus is running under (e.g. "gnome",
	"kde", "other")
* specific to the host name (that will indirectly allow admins to use
	OS-specific and hardware-specific subdirectories)
* subdirectories specific to the group names user running Nau is in
	(e.g. "disk", "floppy", "games"). 
* specific to the user name (at least for "root" it's very useful).

 Having implemented support for scripts this flexible way, Nautilus will be
the dream of admins, VARs and ISVs and of course, users. And it will be
unixish way.

PS: I don't mind to be hired to work on this.

 Best regards,
  -Vlad
  
> John
> 
> on 4/25/01 4:18 AM, Vlad Harchev at hvv hippo ru wrote:
> 
> > On 25 Apr 2001, Mattias Eriksson wrote:
> > 
> > Hi, 
> > 
> > Please look at the support for user menu in Midnight Commander. It uses some
> > useful predictates to decide which menu items to to show (but yes, menu titles
> > are not translatable there too, alas). The other drawback of MC is inability
> > to have several files that define scripts - i.e. MC reads onyly one file for
> > definitions of menu items, but it's better to read all files with some
> > extension in some subdirectory (this is a packager dream).
> > 
> > So, please design support for scripts in a proper way, and not as stupid
> > and broken as Microsoft would do it.
> > 
> > Best regards,
> > -Vlad
> > 
> >> I was looking at tigert's scripts just to get an idea about the script
> >> function. When he showed me the scripts at guadec we talked about that
> >> it would be nice to have the script menu to be mime aware, it doesn't
> >> make much sence to rotate a tar.gz file 90 degrees ;)
> >> 
> >> When I look at the current implementation I see that the scripts are
> >> just placed in the Nautilus/scripts directory and the menu name of the
> >> script is the actual script name. In that directory I find a file that
> >> contains meta info about all the scripts. This solution has some
> >> problems, first it's impossible to translate the script name and it's
> >> also hard to make it mime aware. I would like to see a simmilar file
> >> format as the .desktop format, I don't think that the .desktop format
> >> would support mime types very good so I think it would have to be a new
> >> one. That way all the meta info about a script is in one file, the
> >> scripts can be located anyware in the PATH. It's easy to make
> >> translations and specify mime-types for each script. And one very
> >> important thing, it's still easy to add scripts.
> >> 
> >> what do you think, am I way off again as usual ;)
> >> 
> >> //Snaggen
> > 
> > 
> > 
> > _______________________________________________
> > Nautilus-list mailing list
> > Nautilus-list lists eazel com
> > http://lists.eazel.com/mailman/listinfo/nautilus-list
> 






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