#!/usr/bin/env python import dbus import os import subprocess import shutil import time import sys settings=[("xfce4-desktop","/backdrop/screen0/monitor0/image-path","/usr/share/backgrounds/lliurex-lite.png"), ("xfwm4","/general/theme","lliurex-lite"), ("xfwm4","/general/button_layout","O|HMC"), ("xsettings","/Net/ThemeName","Xfce-kolors"), ("xsettings","/Net/IconThemeName","lliurex-neu"), ("xsettings","/Gtk/FontName","Ubuntu 10") ] print("LliureX-xfce-settings") session = dbus.SessionBus() proxy = session.get_object("org.xfce.Xfconf","/org/xfce/Xfconf") if proxy.PropertyExists("lliurex","/general/Configured"): llx_configured = proxy.GetProperty("lliurex","/general/Configured") if llx_configured=="Yes": sys.exit(0) proxy.SetProperty("lliurex","/general/Configured",dbus.String("Yes",variant_level=1)) print("* Setting XFconf values...") for tmp in settings: channel,property,value=tmp try: proxy.SetProperty(channel,property,dbus.String(value,variant_level=1)) except dbus.DBusException: #just ignore exceptions print "- WARNING: Exception setting property" """ print("Setting Panel...") print ("* Killing panel") p=subprocess.Popen(["xfce4-panel","-x"]) p.communicate() if os.path.exists(os.path.expanduser("~/.config/xfce4/panel")): shutil.rmtree(os.path.expanduser("~/.config/xfce4/panel")) shutil.copytree("/usr/share/lliurex-artwork-xfce-settings/panel",os.path.expanduser("~/.config/xfce4/panel")) p=subprocess.Popen(["xfce4-panel","-r"]) p.communicate() """