1.1 --- a/desktop.py Tue Sep 27 09:52:50 2005 +0000
1.2 +++ b/desktop.py Tue Sep 27 10:05:32 2005 +0000
1.3 @@ -5,10 +5,47 @@
1.4 detection and resource opening support for a selection of common and
1.5 standardised desktop environments.
1.6
1.7 +Desktop Detection
1.8 +-----------------
1.9 +
1.10 To detect a specific desktop environment, use the get_desktop function.
1.11 -To detect whether the desktop environment is standardised (according to a
1.12 +To detect whether the desktop environment is standardised (according to the
1.13 proposed DESKTOP_LAUNCH standard), use the is_standard function.
1.14
1.15 +Opening URLs
1.16 +------------
1.17 +
1.18 +To open a URL in the current desktop environment, relying on the automatic
1.19 +detection of that environment, use the desktop.open function as follows:
1.20 +
1.21 +desktop.open("http://www.python.org")
1.22 +
1.23 +To override the detected desktop, specify the desktop parameter to the open
1.24 +function as follows:
1.25 +
1.26 +desktop.open("http://www.python.org", "KDE") # Insists on KDE
1.27 +desktop.open("http://www.python.org", "GNOME") # Insists on GNOME
1.28 +
1.29 +Without overriding using the desktop parameter, the open function will attempt
1.30 +to use the "standard" desktop opening mechanism which is controlled by the
1.31 +DESKTOP_LAUNCH environment variable as described below.
1.32 +
1.33 +The DESKTOP_LAUNCH Environment Variable
1.34 +---------------------------------------
1.35 +
1.36 +The DESKTOP_LAUNCH environment variable must be shell-quoted where appropriate,
1.37 +as shown in some of the following examples:
1.38 +
1.39 +DESKTOP_LAUNCH="kdialog --msgbox" Should present any opened URLs in
1.40 + their entirety in a KDE message box.
1.41 + (Command "kdialog" plus parameter.)
1.42 +DESKTOP_LAUNCH="my\ opener" Should run the "my opener" program to
1.43 + open URLs.
1.44 + (Command "my opener", no parameters.)
1.45 +DESKTOP_LAUNCH="my\ opener --url" Should run the "my opener" program to
1.46 + open URLs.
1.47 + (Command "my opener" plus parameter.)
1.48 +
1.49 Details of the DESKTOP_LAUNCH environment variable convention can be found here:
1.50 http://lists.freedesktop.org/archives/xdg/2004-August/004489.html
1.51 """