Skip to main content

Simple desktop integration for Python.

Project description

This is a python 3 port of desktop package.

A small example:

import desktop
desktop.open("what/you/want/to/open")

Introduction

The desktop package provides desktop environment detection and resource opening support for a selection of common and standardised desktop environments.

Currently, in Python’s standard library, there is apparently no coherent, cross-platform way of getting the user’s environment to “open” files or resources (showing such files in browsers or editors, for example) when requested by a Python program. There is an os.startfile function which works for Windows, but no equivalent function for other desktop environments - the webbrowser module seems to employ alternative mechanisms in choosing and running external programs and presumably does not seek to provide general support for non-URL resources anyway.

Since desktop environments like KDE and GNOME provide mechanisms for running browsers and editors according to the identified type of a file or resource, just as Windows “runs” files or resources, it is appropriate to have a module which accesses these mechanisms. It is this kind of functionality that the desktop package aims to support. Note that this approach is arguably better than that employed by the webbrowser module since most desktop environments already provide mechanisms for configuring and choosing the user’s preferred programs for various activities, whereas the webbrowser module makes relatively uninformed guesses (for example, opening Firefox on a KDE desktop configured to use Konqueror as the default browser).

Some ideas for desktop detection (XFCE) and URL opening (XFCE, X11) were obtained from the xdg-utils project which seeks to implement programs performing similar functions to those found in the desktop module. The xdg-utils project can be found here:

http://portland.freedesktop.org/

Other information regarding desktop icons and menus, screensavers and MIME configuration can also be found in xdg-utils.

Notes

Notes on desktop application/environment support:

KDE

Supports file and URL opening using kfmclient, where the openURL command opens the resource and the exec command runs the resource.

KDE 4

Similar to KDE but uses kioclient instead of kfmclient.

GNOME

Supports file and URL opening using gnome-open.

XFCE

Supports file and URL opening using exo-open.

ROX-Filer

Supports file opening using “rox <filename>” but not URL opening.

Changelog

  • 0.5.0 (Jul 2, 2016)

    • First release.

Old Changelog

New in desktop 0.4.3 (Changes since desktop 0.4.2)

  • Added missing KDE 4 support to the desktop.dialog module.

New in desktop 0.4.2 (Changes since desktop 0.4.1)

  • Added XFCE 4.10 “mailto:” fix contributed by Jérôme Laheurte.

New in desktop 0.4.1 (Changes since desktop 0.4)

  • Added KDE 4 and Lubuntu support contributed by Jérôme Laheurte.

New in desktop 0.4 (Changes since desktop 0.3)

  • Improved docstrings.

  • Fixed support for examining the root window.

  • Changed the licence to the LGPL version 3 (or later).

New in desktop 0.3 (Changes since desktop 0.2.4)

  • Made desktop a package.

  • Added support for graphical dialogue boxes through programs such as kdialog, zenity and Xdialog.

  • Added support for inspecting desktop windows (currently only for X11).

New in desktop 0.2.4 (Changes since desktop 0.2.3)

  • Added XFCE support (with advice from Miki Tebeka).

  • Added Ubuntu Feisty (7.04) package support.

New in desktop 0.2.3 (Changes since desktop 0.2.2)

  • Added Python 2.3 support (using popen2 instead of subprocess).

New in desktop 0.2.2 (Changes since desktop 0.2.1)

  • Changed the licence to LGPL.

New in desktop 0.2.1 (Changes since desktop 0.2)

  • Added Debian/Ubuntu package support.

New in desktop 0.2 (Changes since desktop 0.1)

  • Added support for waiting for launcher processes.

  • Added a tests directory.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

desktop3-0.5.0.zip (19.5 kB view details)

Uploaded Source

Built Distribution

desktop3-0.5.0-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

Details for the file desktop3-0.5.0.zip.

File metadata

  • Download URL: desktop3-0.5.0.zip
  • Upload date:
  • Size: 19.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for desktop3-0.5.0.zip
Algorithm Hash digest
SHA256 59891c55a6be1dad631e551b7ae823c5876a7df3c643be61ddea73814d1c3531
MD5 4436b08dcf12de2323dd151c0d0ad3e0
BLAKE2b-256 07a1cccb4c25bffa67287a64d7f0278d0ae812a70317624527402bb2680e36ce

See more details on using hashes here.

File details

Details for the file desktop3-0.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for desktop3-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3412f8eebea44ff682e74f4cef1d8e8f98552566d6568e0a841352479b294543
MD5 d0a95e6351cd1a2fbb90343f152d9582
BLAKE2b-256 d2787199ac7c6d79a3d6b03c4fc693cd9455b5aa26dadb0836f7c98e1286001b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page