[pygtk] getting desktop path

Mike Sheldon mike at mikeasoft.com
Fri Jun 4 05:06:58 WST 2010


On Thu, 2010-06-03 at 16:20 +0200, Pasquale Boemio wrote:
> If your sistem is well configurated there is a file in your home
> directory that set some variables.
> Here is mine:
> pau at LittleMonkey ~ $ cat .config/user-dirs.dirs 
> XDG_DESKTOP_DIR="$HOME/Desktop"
> XDG_MUSIC_DIR="/media/PausExt/Musica"
> XDG_DOWNLOAD_DIR="$HOME/Downloads"
> XDG_PUBLICSHARE_DIR="$HOME/Dropbox"
> XDG_PICTURES_DIR="$HOME/Pictures"
> 
> you can use this, but look that some users maybe don't have it!

 It might be better to use the pyxdg module[1] rather than attempting to
read that file directly, that way it can fall back on the system-wide
defaults if a user doesn't have anything configured (or the
freedesktop.org defaults if nothing is specified at the system level).

 Cheers, 
  Mike.

[1] http://www.freedesktop.org/wiki/Software/pyxdg



More information about the pygtk mailing list