3
# This is a helper for the ReleaseUpgrader. it will need to be called
5
# os.system("sudo -u %s theme-switch-helper.py", os.environ["SUDO_USER"])
6
# to make sure that it is run in the users session
11
from optparse import OptionParser
14
parser = OptionParser()
15
parser.add_option("-g", "--get", action="store_true", dest="get",
16
help="get the current gnome/gtk theme settings")
17
parser.add_option("-s", "--set", dest="set",
18
help="set the current gnome/gtk theme settings")
19
parser.add_option("-d", "--defaults", dest="defaults", action="store_true",
20
help="set gtk/gnome settings to save defaults")
21
(options, args) = parser.parse_args()
23
client = gconf.client_get_default()
26
# get current settings
27
gtk_theme = client.get_string("/desktop/gnome/interface/gtk_theme")
28
icon_theme = client.get_string("/desktop/gnome/interface/icon_theme")
29
metacity_theme = client.get_string("/apps/metacity/general/theme")
35
# set to save defaults
36
client.set_string("/desktop/gnome/interface/gtk_theme","Human")
37
client.set_string("/desktop/gnome/interface/icon_theme","Human")
38
client.set_string("/apps/metacity/general/theme","Human")
41
(gtk_theme, icon_theme, metacity_theme) = open(options.set).read().strip().split("\n")
45
client.set_string("/desktop/gnome/interface/gtk_theme", gtk_theme)
46
client.set_string("/desktop/gnome/interface/icon_theme", icon_theme)
47
client.set_string("/apps/metacity/general/theme", metacity_theme)