updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / gdm3setup-native-theme / gdm3setup-native-theme.patch
blob7fb2aabc80236ed0edcbb3ae5b420562820b3755
1 diff -aur a/gdm3setup-daemon.py b/gdm3setup-daemon.py
2 --- a/gdm3setup-daemon.py 2011-11-29 16:00:49.000000000 +0100
3 +++ b/gdm3setup-daemon.py 2011-12-04 12:29:09.367918331 +0100
4 @@ -72,38 +72,6 @@
6 return dbus_address,dbus_pid
8 -def HackShellTheme(b):
9 - if b :
10 - os.rename('/usr/share/gnome-shell/theme','/usr/share/gnome-shell/theme.original')
11 - os.symlink('/usr/share/gnome-shell/theme.original','/usr/share/gnome-shell/theme')
12 - os.symlink('/usr/share/gnome-shell/theme.original','/usr/share/themes/Adwaita/gnome-shell')
13 - else :
14 - os.remove('/usr/share/themes/Adwaita/gnome-shell')
15 - os.remove('/usr/share/gnome-shell/theme')
16 - os.rename('/usr/share/gnome-shell/theme.original','/usr/share/gnome-shell/theme')
18 -def Get_Shell_theme():
19 - if os.path.islink('/usr/share/gnome-shell/theme'):
20 - theme_path = os.readlink('/usr/share/gnome-shell/theme')
21 - if theme_path == '/usr/share/gnome-shell/theme.original':
22 - shell_theme='Adwaita'
23 - else :
24 - tb_path = theme_path.split('/')
25 - shell_theme = tb_path[len(tb_path)-2]
26 - else :
27 - shell_theme='Adwaita'
29 - return shell_theme
31 -def Set_Shell_theme(value):
32 - if value=='Adwaita':
33 - HackShellTheme(False)
34 - else:
35 - if not os.path.islink('/usr/share/gnome-shell/theme'):
36 - HackShellTheme(True)
37 - os.remove('/usr/share/gnome-shell/theme')
38 - os.symlink('/usr/share/themes/'+value+'/gnome-shell','/usr/share/gnome-shell/theme')
40 class GDM3SetupDBusService(dbus.service.Object):
41 def __init__(self):
42 bus=dbus.SystemBus()
43 @@ -127,11 +95,8 @@
44 sender_keyword='sender', connection_keyword='connexion')
45 def SetUI(self,name,value,sender=None, connexion=None):
46 if self.policykit_test(sender,connexion,'apps.nano77.gdm3setup.set') :
47 - if name!='SHELL_THEME':
48 - bus_adrress , bus_pid = Get_Bus()
49 - subprocess.call('su - gdm -s /bin/bash -c "LANG='+LANG+' DBUS_SESSION_BUS_ADDRESS='+bus_adrress+' DBUS_SESSION_BUS_PID='+bus_pid+' set_gdm.sh -n '+name+' -v '+"'"+value+"'"+'"',shell=True)
50 - else :
51 - Set_Shell_theme(value)
52 + bus_adrress , bus_pid = Get_Bus()
53 + subprocess.call('su - gdm -s /bin/bash -c "LANG='+LANG+' DBUS_SESSION_BUS_ADDRESS='+bus_adrress+' DBUS_SESSION_BUS_PID='+bus_pid+' set_gdm.sh -n '+name+' -v '+"'"+value+"'"+'"',shell=True)
55 return "OK"
56 else :
57 @@ -144,7 +109,6 @@
58 settings = ifile.readlines()
59 ifile.close()
60 os.remove("/tmp/GET_GDM")
61 - settings.append("SHELL='"+Get_Shell_theme()+"'\n")
62 return settings
64 @dbus.service.method('apps.nano77.gdm3setup','bsbi','s',sender_keyword='sender', connection_keyword='connexion')
65 diff -aur a/get_gdm.sh b/get_gdm.sh
66 --- a/get_gdm.sh 2011-11-13 00:40:20.000000000 +0100
67 +++ b/get_gdm.sh 2011-11-16 14:07:58.087329638 +0100
68 @@ -4,6 +4,8 @@
70 echo -n "GTK=" > /tmp/GET_GDM
71 gsettings get org.gnome.desktop.interface gtk-theme >> /tmp/GET_GDM
72 +echo -n "SHELL=" >> /tmp/GET_GDM
73 +gsettings get org.gnome.shell theme-name >> /tmp/GET_GDM
74 echo -n "ICON=" >> /tmp/GET_GDM
75 gsettings get org.gnome.desktop.interface icon-theme >> /tmp/GET_GDM
76 echo -n "FONT=" >> /tmp/GET_GDM
77 diff -aur a/set_gdm.sh b/set_gdm.sh
78 --- a/set_gdm.sh 2011-12-23 12:48:13.000000000 +0100
79 +++ b/set_gdm.sh 2011-12-23 12:50:13.674599183 +0100
80 @@ -63,6 +63,10 @@
81 echo "$parameter_name = $parameter_value"
82 gsettings set org.gnome.desktop.interface gtk-theme "$parameter_value"
84 + SHELL_THEME)
85 + echo "$parameter_name = $parameter_value"
86 + gsettings set org.gnome.shell theme-name "$parameter_value"
87 + ;;
88 FONT)
89 echo "$parameter_name = $parameter_value"
90 gsettings set org.gnome.desktop.interface font-name "$parameter_value"