#! /usr/bin/python # -*- encoding: utf-8 -*- # Random Gnome Theme - Change gnome theme randomly just by a click! # version 0.1, 2006.4.23 # gconftool-2 version: 2.14.0 # Copyright (C) 2006 Pan Yongzhi # Reach me: http://pan.cdut.cn or fossilet@@163..com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA # or see http://www.gnu.org/copyleft/gpl.html. # import random, os # Gnome主题的控制和窗口边框位于/usr/share/themes和~/.themes下,图标和鼠标箭头都在/usr/share/icons和~/.icons下,/usr/X11R6/lib/X11/icons下也有鼠标箭头,不过要把此目录复制或链接到~/.icons下Gnome才能找到。 # themes, including control and window borders themes = ['1970_xeno', '3000_xeno', 'AgingGorilla', 'Amaranth', 'AquaXen', 'Atlanta', 'Bluecurve', 'Bluecurve-BerriesAndCream', 'Bluecurve-classic', 'Bluecurve-Gnome', 'Bluecurve-Grape', 'Bluecurve-Lime', 'Bluecurve-Slate', 'Bluecurve-Strawberry', 'Bluecurve-Tangerine', 'Bright', 'CleanIce', 'CleanIce-Dark', 'CleanIce-Debian', 'Clearlooks', 'CortlandChicken', 'Crux', 'DebianRed', 'Default', 'Emacs', 'Esco', 'Galaxy', 'Geramik', 'Glider', 'Gorilla', 'Grand-Canyon', 'GTKBe', 'Indubstrial', 'Industrial', 'LighthouseBlue', 'Lush', 'MacOS-X', 'MagicChicken', 'Metabox', 'metacity-1', 'Metal', 'Mist', 'NeXTStep', 'Notif', 'Nuvola', 'Nuvola-old', 'Ocean-Dream', 'OkayishChicken', 'Pixmap', 'Purplephilia', 'Raleigh', 'Redmond', 'Redmond95', 'Sandwish', 'Simple', 'Smokey', 'Smokey-Blue', 'SphereCrystal', 'ThinGeramik', 'ThinIce', 'Traditional', 'Wasp', 'WindowMaker', 'Xeneon', 'XenoAdept', 'Xeno Buffed', 'Xeno Gradient', 'Xeno Helix', 'XenoLight', 'Xeno Perkele', 'Xenophilia', 'XenoProgeny', 'XenoQt2k', 'Xeno Thin', 'Xen-SentiEnce', 'Xfce', 'Xfce-4.0', 'Xfce-b5', 'Xfce-basic', 'Xfce-cadmium', 'Xfce-curve', 'Xfce-dawn', 'Xfce-dusk', 'Xfce-kde2', 'Xfce-kolors', 'Xfce-light', 'Xfce-redmondxp', 'Xfce-saltlake', 'Xfce-smooth', 'Xfce-stellar', 'Xfce-winter']; icons = ['Amaranth', 'Bluecurve', 'Crux', 'crystalsvg', 'Flat-Blue', 'gartoon', 'gnome', 'Gorilla', 'Industrial', 'Lush', 'MacOS-X', 'Nuvola', 'Rodent', 'Sandy', 'Smokey-Blue', 'Smokey-Red', 'SphereCrystal', 'Suede', 'Wasp']; cursors = ['crystalblue', 'crystalblue_classic', 'crystalblue_nonanim', 'crystalgray', 'crystalgray_nonanim', 'crystalgreen', 'crystalgreen_classic', 'crystalgreen_nonanim', 'crystalwhite', 'crystalwhite_nonanim'] control = "'"+random.choice(themes)+"'" border = "'"+random.choice(themes)+"'" icon = "'"+random.choice(icons)+"'" cursor = "'"+random.choice(cursors)+"'" print 'Applying control '+control+', window border '+border+', icon '+icon+' and cursor '+cursor+'...' # Change the control os.system('gconftool-2 --type string -s /desktop/gnome/interface/gtk_theme'+' '+control) # Change the window border os.system('gconftool-2 --type string -s /apps/metacity/general/theme'+' '+border) # Change the icon os.system('gconftool-2 --type string -s /desktop/gnome/interface/icon_theme'+' '+icon) # Change the cursor os.system('gconftool-2 --type string -s /desktop/gnome/peripherals/mouse/cursor_theme'+' '+cursor)