#! /usr/bin/python3 import sys import os import os.path import shutil from gi.repository import Gio #print ("inicio") cmd='dconf reset -f /' skel_panel='/etc/skel/.config/xfce4/panel' home_path=os.path.expanduser('~') local_panel=home_path+'/.config/xfce4/panel' def copy_and_overwrite(from_path, to_path): if os.path.exists(to_path): shutil.rmtree(to_path) shutil.copytree(from_path, to_path) #def copy_and_overwrite #Restore Desktop profile os.system(cmd) #Restore Main LliureX Menu if os.path.isdir(skel_panel): print('Copy skel from %s to %s' %(skel_panel,local_panel)) copy_and_overwrite(skel_panel, local_panel) #Relaunch dock if it isn't active try: settings = Gio.Settings("org.mate.session.required-components") dock=settings.get_string("dock") if len(dock) > 0: ret=os.system("ps aux | grep $USER | grep %s | grep -v grep"%dock) if ret!=0: os.system("%s &"%dock) except: pass #print ("FIN")