LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-14-2008, 08:32 PM   #1
Muzzaw
LQ Newbie
 
Registered: Jul 2008
Posts: 5

Rep: Reputation: 0
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
multiple times, is it possible to execute the command once and have the link populate to all user's desktops?

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.
 
Old 07-14-2008, 09:29 PM   #2
gregg_a_g
LQ Newbie
 
Registered: Dec 2002
Posts: 11

Rep: Reputation: 0
Smile

How about this. At a command prompt as su, type:

for i in /home/*; do ln -s /usr/bin/konsole $i;done
 
Old 07-14-2008, 09:32 PM   #3
Muzzaw
LQ Newbie
 
Registered: Jul 2008
Posts: 5

Original Poster
Rep: Reputation: 0
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.
 
Old 07-14-2008, 09:34 PM   #4
Muzzaw
LQ Newbie
 
Registered: Jul 2008
Posts: 5

Original Poster
Rep: Reputation: 0
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?
 
Old 07-14-2008, 09:59 PM   #5
gregg_a_g
LQ Newbie
 
Registered: Dec 2002
Posts: 11

Rep: Reputation: 0
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.
 
Old 07-14-2008, 10:19 PM   #6
Muzzaw
LQ Newbie
 
Registered: Jul 2008
Posts: 5

Original Poster
Rep: Reputation: 0
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.
 
Old 07-14-2008, 10:36 PM   #7
gregg_a_g
LQ Newbie
 
Registered: Dec 2002
Posts: 11

Rep: Reputation: 0
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!
 
Old 07-14-2008, 11:09 PM   #8
Muzzaw
LQ Newbie
 
Registered: Jul 2008
Posts: 5

Original Poster
Rep: Reputation: 0
Talking

Some nice bedtime reading, thanks!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating multiple x desktops mathimca05 Linux - Newbie 1 12-06-2007 10:36 PM
Copying an icon to all desktops bobthehorrible Linux - Newbie 2 12-06-2005 08:30 AM
creating desktop icon oingram Linux - Software 6 12-31-2004 03:39 AM
Trash, Computer & user's home icon changed to read-only tuxrules Fedora 1 08-12-2004 03:49 PM
Creating Desktop Icon biggiefatts Linux - Software 4 05-27-2002 12:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration