Re: Help? Desktop launchers



	This doesn't seem like it's unreasonably hard.  Let me make a 
sugestion, but I'll preface it by saying I haven't acutally done this 
myself.  This is really just a sugestion to get you on the righ track.
	If we start by creating a desktop launcher for an example we can
see that it's pretty much a simple text file.  All desktop launchers
(under gnome 2) are created in ~/Desktop.  A quick look at my desktop 
shows:

[sleepylight host65-239 ~/Desktop]$ ls
hammer-003697262e.desktop*  opt@  Start Here  test.desktop*  tmp@  Trash/

and if we look at the test launcher I just made it looks like:

[sleepylight host65-239 ~/Desktop]$ cat test.desktop
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Exec=/usr/local/foo
TryExec=
Icon=/usr/share/pixmaps/default-applications-capplet.png
X-GNOME-DocPath=
Terminal=false
Name[en_US]=test
GenericName[en_US]=test launcher
Comment[en_US]=an example launcher

	Not that bad eh?  You don't even have to write all that stuff
yourself, it's generated when you build the launcher.  So lets say you
need 5 launchers to add to desktops.  Just start by making them on your
own desktop, then copy them to some easily accessable place (/tmp or
/usr/local/share or something like that).  Now, with those files in place
it's a pretty easy task for a shell script or maybe a perl script to put
them in place.
	Write a script that does the following things:
1 - Create a Desktop directory in the new user's home
2 - Copy the launchers from their stored location to the Desktop
3 - chmod the launchers to the right permissions
4 - chown -R username.group the whole Desktop directory.

	As far as I know gnome will not overwrite the desktop the first 
time it's run.  It will do that for any missing files though.  If you 
really want to be clever, you could add a call to your script in the 
user's .login file.  The script could look to see that all the launchers 
are there and (re)copy any that aren't in the right place.  This would 
also handle the case where someone accidently erases a launcher.  Now, 
there may be an easier way to do this, and there may be some default 
template menu I don't know about, but if someone were to ask me how I 
would do this, this is the way I'd go.

Best of luck.  



-- 


-Maxwell Bottiger

This thing is like a wolf
This thing is a wolf
Thus, it is a thing to be bansished





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]