1.1 --- a/README.txt Mon Sep 26 12:09:52 2005 +0000
1.2 +++ b/README.txt Tue Sep 27 09:52:50 2005 +0000
1.3 @@ -8,3 +8,10 @@
1.4
1.5 ROX-Filer Supports file opening using "rox <filename>" but not URL
1.6 opening.
1.7 +
1.8 +Usage of the DESKTOP_LAUNCH environment variable:
1.9 +
1.10 +DESKTOP_LAUNCH="kdialog --msgbox" Should present any opened URLs in
1.11 + their entirety in a message box.
1.12 +DESKTOP_LAUNCH="test\ this" Should run the "test this" program to
1.13 + open URLs.
2.1 --- a/desktop.py Mon Sep 26 12:09:52 2005 +0000
2.2 +++ b/desktop.py Tue Sep 27 09:52:50 2005 +0000
2.3 @@ -16,6 +16,7 @@
2.4 import os
2.5 import sys
2.6 import subprocess
2.7 +import commands
2.8
2.9 def get_desktop():
2.10
2.11 @@ -56,7 +57,8 @@
2.12
2.13 Suggested values for 'desktop' are "standard", "KDE", "GNOME", "Mac OS X",
2.14 "Windows" where "standard" employs a DESKTOP_LAUNCH environment variable to
2.15 - open the specified 'url'.
2.16 + open the specified 'url'. DESKTOP_LAUNCH should be a command, possibly
2.17 + followed by arguments, and must have any special characters shell-escaped.
2.18
2.19 The process identifier of the "opener" (ie. viewer, editor, browser or
2.20 program) associated with the 'url' is returned by this function. If the
2.21 @@ -70,9 +72,8 @@
2.22 # Start with desktops whose existence can be easily tested.
2.23
2.24 if (desktop is None or desktop == "standard") and is_standard():
2.25 - # NOTE: This may not handle sophisticated commands properly.
2.26 - cmd = os.environ["DESKTOP_LAUNCH"].split()
2.27 - cmd.append(url)
2.28 + arg = "".join([os.environ["DESKTOP_LAUNCH"], commands.mkarg(url)])
2.29 + return subprocess.Popen(arg, shell=1).pid
2.30
2.31 elif (desktop is None or desktop == "Windows") and detected == "Windows":
2.32 # NOTE: This returns None in current implementations.