Add a substitution $(username) which is replaced with the current system user.
To try it out, the following snippet should print the currently logged in user:
xsubst = createUnoService("com.sun.star.comp.framework.PathSubstitution")
print xSubst.getSubstituteVariableValue( "$(username)")
Where is this supposed to be used?
(In reply to Stephan Bergmann from comment #3)
> Where is this supposed to be used?
We have a client who wants to set some paths to be not in the user profile, but in a separate directory on another hard drive (because of backup strategy).
So for example have the autocorrect data in a folder like
Since multiple people use the same pc, the path needs to be individual for each person. Thus the need to replace $(username) with the currently logged in user.
Samuel Mehrbrodt committed a patch related to this issue.
It has been pushed to "master":
tdf#98407 PathSubstitution: Add substitution for $(username)
It will be available in 5.2.0.
The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
Affected users are encouraged to test the fix and report feedback.
(Starting with the fix from issue 101898 comment 33, "$(username)" will be substituted for the username only if the username is a complete URL segment. That is, if the username is "USER", <file:///data/USER/office> will be substituted
to <file:///data/$(username)/office>, but <file:///data/USERSPACE/office> will remain unchanged.)