Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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!

share|improve this question
add comment

1 Answer

Instead of writing a script for that, remove the actual ~/Desktop folder (if it is empty), and create a link to ~/Downloads in its place:

rm -r -i ~/Desktop
ln -s ~/Downloads ~/Desktop
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.