3

My bash script should copy files from /opt/test/file.txt to the user's Desktop. The source path is always the same, but how do I copy to desktop? The desktop has a different name in every language...

in German it is for example: cd $HOME/Arbeitsfläche and not $HOME/Desktop

1 Answer 1

4

User directories are defined in a parsable file ~/.config/user-dirs.dirs. To get the value set for a different locale our script may have to import these variables.

Example:

source ~/.config/user-dirs.dirs
echo $XDG_DESKTOP_DIR

Also see: Freedesktop.org Wiki

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .