# Support for localized user directories into Fvwm-Crystal
# Written by: Dominique Michel <dominique_libre@sourceforge.net> 2013
# see /etc/xdg/user-dirs.defaults and http://freedesktop.org/wiki/Software/xdg-user-dirs

# Be sure the xdg user directories file exist in $HOME
PipeRead 'test ! -f ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs && xdg-user-dirs-update'

# We want them to be globals for the user and with full path
PipeRead 'test -f ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs && . ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs; \
	echo SetEnv XDG_MUSIC_DIR ${XDG_MUSIC_DIR:-$HOME}; \
	echo SetEnv XDG_VIDEOS_DIR ${XDG_VIDEOS_DIR:-$HOME}; \
	echo SetEnv XDG_DESKTOP_DIR ${XDG_DESKTOP_DIR:-$HOME/Desktop}; \
	echo SetEnv XDG_DOWNLOAD_DIR ${XDG_DOWNLOAD_DIR:-$HOME}; \
	echo SetEnv XDG_TEMPLATES_DIR ${XDG_TEMPLATES_DIR:-$HOME}; \
	echo SetEnv XDG_PUBLICSHARE_DIR ${XDG_PUBLICSHARE_DIR:-$HOME}; \
	echo SetEnv XDG_DOCUMENTS_DIR ${XDG_DOCUMENTS_DIR:-$HOME}; \
	echo SetEnv XDG_PICTURES_DIR ${XDG_PICTURES_DIR:-$HOME}'
