1.1 --- a/README.txt Tue Sep 27 09:52:50 2005 +0000
1.2 +++ b/README.txt Tue Sep 27 10:05:32 2005 +0000
1.3 @@ -8,10 +8,3 @@
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 Tue Sep 27 09:52:50 2005 +0000
2.2 +++ b/desktop.py Tue Sep 27 10:05:32 2005 +0000
2.3 @@ -5,10 +5,47 @@
2.4 detection and resource opening support for a selection of common and
2.5 standardised desktop environments.
2.6
2.7 +Desktop Detection
2.8 +-----------------
2.9 +
2.10 To detect a specific desktop environment, use the get_desktop function.
2.11 -To detect whether the desktop environment is standardised (according to a
2.12 +To detect whether the desktop environment is standardised (according to the
2.13 proposed DESKTOP_LAUNCH standard), use the is_standard function.
2.14
2.15 +Opening URLs
2.16 +------------
2.17 +
2.18 +To open a URL in the current desktop environment, relying on the automatic
2.19 +detection of that environment, use the desktop.open function as follows:
2.20 +
2.21 +desktop.open("http://www.python.org")
2.22 +
2.23 +To override the detected desktop, specify the desktop parameter to the open
2.24 +function as follows:
2.25 +
2.26 +desktop.open("http://www.python.org", "KDE") # Insists on KDE
2.27 +desktop.open("http://www.python.org", "GNOME") # Insists on GNOME
2.28 +
2.29 +Without overriding using the desktop parameter, the open function will attempt
2.30 +to use the "standard" desktop opening mechanism which is controlled by the
2.31 +DESKTOP_LAUNCH environment variable as described below.
2.32 +
2.33 +The DESKTOP_LAUNCH Environment Variable
2.34 +---------------------------------------
2.35 +
2.36 +The DESKTOP_LAUNCH environment variable must be shell-quoted where appropriate,
2.37 +as shown in some of the following examples:
2.38 +
2.39 +DESKTOP_LAUNCH="kdialog --msgbox" Should present any opened URLs in
2.40 + their entirety in a KDE message box.
2.41 + (Command "kdialog" plus parameter.)
2.42 +DESKTOP_LAUNCH="my\ opener" Should run the "my opener" program to
2.43 + open URLs.
2.44 + (Command "my opener", no parameters.)
2.45 +DESKTOP_LAUNCH="my\ opener --url" Should run the "my opener" program to
2.46 + open URLs.
2.47 + (Command "my opener" plus parameter.)
2.48 +
2.49 Details of the DESKTOP_LAUNCH environment variable convention can be found here:
2.50 http://lists.freedesktop.org/archives/xdg/2004-August/004489.html
2.51 """