Creating an icon on all user's desktops
Hi all,
Relatively new to Linux and any help is appreciated. I would like to set up a link to "konsole" on all my user's desktops. Rather than typing: Code:
ln -s /usr/bin/konsole /home/USER_NAME I'm looking through the man page for "ln" but cannot see options for multiple destination directories, or any clues as to how I can pull this off. Can anyone point in the direction of further reading to help solve this? Cheers, James. |
How about this. At a command prompt as su, type:
for i in /home/*; do ln -s /usr/bin/konsole $i;done |
Thanks alot! I'll have a go when I get home.
But will that end up placing multiple icons on desktops that already have the icon on them? Cheers, James. |
I'm still getting familiar with the syntax of the shell. Is it possible to implement your above script, but run a check to see if the link is present on the user's desktop?
|
How about this then? At a command prompt as su, type:
for i in /home/*; do ln -sf /usr/bin/konsole $i;done The difference is the "f". That means, "force", or "remove existing destination file". So if you already have a link, the "f" will clobber the file and overwrite. If you don't use the "f" and there is already a link, you won't get "multiple" icons. The little shell thingy will just fail at some point. So you might not get all of the links in. It will be safe to use the line as shown above. :) |
Thanks, I'll give it a shot and you let you know how I get on.
Would you mind explaining the syntax of the 'for' loop you've used? It looks pretty simple, but is different than what I'm used to. Thanks again, James. |
For reference on the bash shell, you can look here:
http://www.gnu.org/software/bash/manual/bashref.html or for more advanced topics: http://tldp.org/LDP/abs/html/ Have fun! :) :study: |
Some nice bedtime reading, thanks!
|
All times are GMT -5. The time now is 11:55 PM. |