PDA

View Full Version : Can I modify through shell "system--preferences--appearance--interface" settings?



giuspen
October 27th, 2009, 03:06 PM
Is it possible to write a bash/python script to edit the ubuntu/gnome settings:

system->preferences->appearance->interface

such as the checkbox "Show icons in menus" or the combobox "Toolbar button labels"?

Thanks in advance.

giuspen
October 31st, 2009, 04:36 AM
if anybody interested, using python a possible solution is:


#!/usr/bin/env python

import subprocess

subprocess.call("gconftool-2 --set /desktop/gnome/interface/menus_have_icons --type bool 1", shell=True)

kaibob
October 31st, 2009, 04:57 AM
Most of these settings are in gconf repository. For example,


/desktop/gnome/interface/menus_have_icons

The following is an example of how command-line changes can be made to gconf keys:


gconftool-2 --type bool --set /apps/panel/global/locked_down true

diesch
October 31st, 2009, 05:55 AM
if anybody interested, using python a possible solution is:


#!/usr/bin/env python

import subprocess

subprocess.call("gconftool-2 --set /desktop/gnome/interface/menus_have_icons --type bool 1", shell=True)

If all you want to do is to run a program you better use the shell instead a Python:


#/bin/sh
gconftool-2 --set /desktop/gnome/interface/menus_have_icons --type bool true
If you use Python to set GConf properties you may want to use easygconf (http://www.florian-diesch.de/software/easygconf/):


#!/usr/bin/env python

import easygconf

d = easygconf.GConfDict('/desktop/gnome/interface/')
d['menus_have_icons'] = True