Re: Integrate VMware and Gnome



On 13 Oct 1999, Regis Duchesne wrote:

> File name to mime-type bindings
> -------------------------------
> I have created a vmware.mime file in the system-wide mime-info
> directory. It is based on regex for the VMware binaries, and on
> extension for the VMware config files (the .cfg files).
> 
> Q: It is my understanding that Gnome also support content analysis to
>    determine the file type (something like the 'file' command) through
>    the mime-magic database. Does the gmc file manager make use of content
>    analysis?

It can, yes.

> Q: I would like to define a mime type like this: "A file is a VMware
>    configuration file if: its extension is .cfg _and_ its first line
>    matches the regex: '#!.*/vmware.* ' Is it possible?

Not currently. The vmware behaviour should not depend on the extension of
the file that it is being run with, so just the '#!.*/vmware.*' pattern
should do.

> Mime-type to metadata bindings
> ------------------------------
> I have created a vmware.keys file in the system-wide mime-info
> directory. It defines icons for some VMware binaries, and the 'open'
> action for VMware configuration files (typically it calls vmware with
> the file as an argument).
>
> Q: I cannot manage to change the 'open' action of the VMware main
>    binary? Is it because it is an ELF executable and executables are
>    special cased and always executed when they are double-clicked?

Yes - there really isn't any other sane open action...

> Q: I have problems with the current directory. Let's say I have on my
>    desktop 2 symlinks:
>
>     A) A symlink to vmware
>     B) A symlink to a directory containing a .cfg file
>
>    . I double-click on B). A gmc window pops up, showing the .cfg
>      file. I keep the window open
>    . I double-click on A). It executes vmware. I exit the program. Perfect.
>    . I double-click on the .cfg file. Problem: the current directory
>      is ~/.gnome-desktop and it should be the directory pointed by the
>      B) symlink
>    . I double-click again on A). This time the current directory is
>      correctly set
> 
>    I think this is a bug. I'm using Gnome gmc 4.5.40

Please use the gnome-bug script to file a bug report. These instructions
should be sufficiently

>    In a general way, is it possible to retrieve the real location of
>    the file (%F would be a good candidate) instead of the file itself
>    (%f) when the file is a symlink?

If a file is a symlink, you can use 'readlink' to find its real location.
Having the symlink name passed is probably a better idea.

> Desktop
> -------
> Ideally, during the phase of configuration of VMware, I would like
> to prompt the sysadmin to put VMware icons on the desktop of users.
>
> I know about the mc/desktop-scripts directory, but it is my
> understanding that things that I put in (URL, program to generate
> desktop icons) are only executed:
>
>   . When a new desktop is created
>   . When the user does a right click->"Recreate Default cons"
>
> I would like to give each user the opportunity to automatically place
> icons on their desktop, without annoying them of course.

> Q: Is there a way to run a program each time a user opens its first
>    gmc session? This program could prompt the user 'do you want VMware 
>    icons on your desktop?' And if the user says yes, it would create
>    the icons. Of course, the program should be given the user's
>    desktop directory as an argument
 
> The previous way to do it is cool, but if the user installs Vmware
> while he is running gnome, he will not see the new icons until he
> exits and re-opens the gmc session.
> 
> Q: Is there a way to detect that a user is currently running gnome?

Not explicitly, no. But see below.

> Q: Is there a way to automatically do a right click->"Rescan Desktop
>    Directory"? So that a program could generate icons and have them
>    appear automatically on the user's desktop? I'm talking about a
>    simple way here (from a shell or a perl script). I don't want to
>    use the Gnome API to do this.

There is a 'gmc-client' program (not currently included in the October
GNOME packages, but you could include a binary with your program) that can
do this. This talks to the file manager if it's running and can do things
like ask for a rescan.

> Menus
> -----
> I would like to create menu entries for VMware (something similar to a
> 'VMware' entry in the start menu of Windows)
> 
> Q: I guess it is possible to do it, but I don't know how to do it
>    simply with a shell or perl script. Basically, I haven't found any
>    documentation explaining how menu (or the menu editor) work, and
>    what files I need to modify. Can somebody help me?

You need to just place a .desktop file in the appropriate directory under
/usr/share/gnome/apps - that's all. Examples of .desktop files abound :)

> Misc
> ----
> Q: I currently use 48x48 icons for desktop icons, and they seem to be
>    down sampled for menu entries. Is there a way to specify different
>    icons (with different sizes) for the same file? Will Gnome choose
>    the best format? It is not a big deal, it is just that our 16x16
>    icons (that our graphic artist designed) look better than the down
>    sampled ones.

> Q: In this email, I have referred to a lot a gnome directories. Is
>    there a central database (whose location does not change) where
>    these directories ($PREFIX, $LIBDIR) are stored? We need to install 
>    our stuff on tons of distributions, and all of them have chosen
>    different places for those directories :(

The libgnome/gnome-util.h routines can get you this information at
runtime, I think.

I'll leave the other questions for others to answer.
-- Elliot					http://developer.gnome.org/
The first thing a programmer needs to admit is that any program is by far
more complex than his own mind. Thats why he partitions it into neat
pieces and avoids complexity.



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