Hi,
It indeed seems that there is not a nice 'standard' way to open files by their file association in Linux. I found that this can be done in a few ways:
On GNOME desktop:
- Code: Select all
gnome-open
On KDE desktop:
- Code: Select all
kde-open
Window-manager-neutral program:
- Code: Select all
xdg-open
This is part of the xdg-utils package.
I added the following lines specific for Linux to the org.openmicroscopy.shoola.env.data.model.ApplicationData class:
- Code: Select all
public List<String> getArguments()
{
List<String> list = new ArrayList<String>();
if (UIUtilities.isMacOS()) {
if (executable != null && executable.length() > 0)
list.add(executable);
else list.add("open");
if (commands != null && commands.size() > 0)
list.addAll(commands);
} else if (UIUtilities.isWindowsOS()) {
} else if (UIUtilities.isLinuxOS()) {
if (executable != null && executable.length() > 0)
list.add(executable);
else list.add("xdg-open");
if (commands != null && commands.size() > 0)
list.addAll(commands);
}
return list;
}
This now works for me. However I am not sure if xdg-utils is installed on every Linux OS.
@Will
I have been using the command-line script running facility to quickly run my scripts outside of Insight. It is very useful. I generally have three terminals open: one for uploading/launching the script; one in $OMERO_DIR/Files for looking at the stdout and stderr text files generated by OMERO; and one in the /tmp dir for looking at my temporary working files.
In addition I develop my scripts to run as standalone python scripts that manually connect to OMERO and call the main run() function passing the connection and a hard-coded params dictionary. I can quickly switch this to a different start-up function that obtains the connection using the scripting method and populates the params dictionary from the client. This way I can develop my script without the upload/replace/launch calls to 'omero script'. It saves a few minutes per day.
Alex