[Thunar-dev] system-wide document templates with thunar

Mike Massonnet mmassonnet at gmail.com
Sat Nov 22 23:32:45 CET 2008


Le Sat, 22 Nov 2008 12:35:42 +0100,
Jelle de Jong <jelledejong at powercraft.nl> a écrit :

> Brian J. Tarricone wrote:
> > Jelle de Jong wrote:
> >> Hi everybody,
> >>
> >> I am searching for a way to use the document template system with a
> >> system wide configuration. So instead of the /home/user/Templates
> >> directory something like /etc/templates or /usr/share/templates.
> >>
> >> And I am not really looking for a symbolic link to from user home
> >> to system dir solution :-p.
> >>
> >> Is this possible?
> > 
> > Yes and no.  In the 4.4-era releases, no, not at all.
> > 
> > In the 4.6 beta, you can by configuring the templates dir in 
> > xdg-user-dirs (google that).  But you have to set the templates dir
> > for all users -- I guess a default config in /etc/skel would work
> > for that.
> > 
> > But note that this won't let you have a system dir and user dir for 
> > templates that get merged -- you can only have one dir for
> > templates.
> > 
> > 	-brian
> > 
> 
> Thank you Brian for taking the time to answer.
> 
> If I read the code and description correctly the users should set his
> directories in the user-dirs.dirs.

Very quickly:

% cat .config/user-dirs.dirs 
# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
# 
XDG_DESKTOP_DIR="$HOME/.local/desktop"
XDG_DOWNLOAD_DIR="$HOME/downloads"
XDG_TEMPLATES_DIR="$HOME/Templates"
#XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_DOCUMENTS_DIR="$HOME/documents"
XDG_MUSIC_DIR="$HOME/music"
XDG_PICTURES_DIR="$HOME/images"
XDG_VIDEOS_DIR="$HOME/videos"

> However is this file in the $HOME/.config/user-dirs.dirs or in the
> $HOME/user-dirs.dirs. I hope the first, else the config file is always
> visible.
> 
> However I saw that the paths are relative to the home directory I hope
> it will work with a fixed patch starting from the root patch
> /usr/share/templates
> 
> I also wonder why there is not a system width config file that can be
> overridden by the users configuration.

But then they wouldn't have the system wide templates.  As said there
is no merge system possible here.

> Sometimes I love to read beautifully coding, check this out:
> http://webcvs.freedesktop.org/user-dirs/xdg-user-dirs/xdg-user-dirs-update.c?view=markup
> 
> Thanks for the answers,
> 
> Best regards,
> 
> Jelle

Mike



More information about the Thunar-dev mailing list