Re: Gnome - Site Confiuguration Question



Part of the information about the desktop icons is stored in
~/.gnome/metadata.db.  I wrote a small script that will extract all the
information in this file to a python script that when run will reconstruct
the metadata database.

You will need gnome-python installed on your system for this to work (the
pygnome RPM or python-gnome DEB + its dependencies).  It may be useful for
setting up a number of systems.  It could probably be modified to strip
$HOME from the filenames in metadata.db and output code like "home+'...'"
and set home to os.environ['HOME'] at the top of the script.

Hopefully this will be of use to some people.

James.

--
Email: james@daa.com.au
WWW:   http://www.daa.com.au/~james/


On Tue, 5 Oct 1999, Richard Black wrote:

> > On Tue, Oct 05, 1999 at 01:44:07PM +0100 or thereabouts, Richard Black wrote:
> > > How do I alter the default gnome configuration for new users on a 
> > > site-specific basis?  E.g. where do the original .gnome-desktop/ files come 
> > > from?
> > 
> > locate default.session
> > 
> > On Red Hat Linux 6.0 this is /usr/share/gnome/default.session 
> > but I don't know whether this is the same everywhere.
> > 
> > I -think- that's what you want. I'm sure someone'll correct me
> > if not. It starts, 
> > # This is the default session that is launched if the user doesn't
> > # already have a session.
> > so it looks promising.
> 
> Yes I'd found that, but it doesn't show where (for example) the 
> .gnome-desktop/RH.com
> 
> file comes from, for people who need to customise such things (desktop icons 
> and the like).
> 
> Richard.
> 
> 
> 
> -- 
>         FAQ: Frequently-Asked Questions at http://www.gnome.org/gnomefaq
>          To unsubscribe: mail gnome-list-request@gnome.org with 
>                        "unsubscribe" as the Subject.
> 
#!/usr/bin/env python

import sys, os, string, bsddb

if len(sys.argv) < 2:
	sys.argv.append('%s/.gnome/metadata.db' % os.environ['HOME'])

db = bsddb.hashopen(sys.argv[1], 'r')

print "#!/usr/bin/env python"
print "import gnome.metadata"
print

set_pattern = 'gnome.metadata.set(%s, %s, %s)'
regex_pattern = 'gnome.metadata.regex_add(%s, %s, %s)'
type_pattern = 'gnome.metadata.type_add(%s, %s, %s)'

for key in db.keys():
	split = string.split(key, '\0')
	data = db[key]

	if split[0] == 'file':
		print set_pattern % (`split[1]`, `split[2]`, `data`)
	if split[0] == 'regex':
		print regex_pattern % (`split[1]`, `split[2]`, `data`)
	if split[0] == 'type':
		print type_pattern % (`split[1]`, `split[2]`, `key`)
db.close()



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