This is my first question here, I'm trying to create a little script, that change icons shown in Desktop. I mean, when I Click on a button, I would launch this simple script
cp $HOME/.config/Desktop5/user-dirs.dirs $HOME/.config
in Desktop5/user.dirs i wrote:
XDG_DESKTOP_DIR="$HOME/Downloads"
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/Pictures"
XDG_VIDEOS_DIR="$HOME/Videos"
I wrote 5 script for each most used folder: Downloads, Pictures, Music, Desktop and Videos
It works, but unfortunately, sometimes the desktop doesn't refresh soon and I have to click several time the same button before than see desktop icons, change.
How can I resolve this problem?
Edit:
I thanks for the answer, i substituded
`cp $HOME/.config/Desktop5/user-dirs.dirs $HOME/.config`
with this two command:
rm -r ~/Desktop
ln -s ~/Downloads ~/Desktop
I Couldn't use
rm -r-i ~/Desktop
because this command was launched by a script now it works!