Permalink
Browse files

Gnome 3.6 support

  • Loading branch information...
1 parent 7cc7f9e commit f53d8cc38c58a351bcdf763679d6b58fd881c709 @Nano77 committed Oct 11, 2012
Showing with 108 additions and 9 deletions.
  1. +57 −6 gdm3setup.py
  2. +28 −0 gdm3setup.ui
  3. +21 −3 get_gdm.sh
  4. +2 −0 set_gdm.sh
View
@@ -508,6 +508,8 @@ def __init__(self) :
self.ComboBox_gtk = self.Builder.get_object("ComboBox_gtk")
self.CheckButton_banner = self.Builder.get_object("CheckButton_banner")
self.Entry_banner_text = self.Builder.get_object("Entry_banner_text")
+ self.CheckButton_banner6 = self.Builder.get_object("CheckButton_banner6")
+ self.Entry_banner_text6 = self.Builder.get_object("Entry_banner_text6")
self.CheckButton_user = self.Builder.get_object("CheckButton_user")
self.CheckButton_restart = self.Builder.get_object("CheckButton_restart")
self.Button_autologin = self.Builder.get_object("Button_autologin")
@@ -522,6 +524,8 @@ def __init__(self) :
self.GetAutoLogin = proxy.get_dbus_method('GetAutoLogin','apps.nano77.gdm3setup')
self.StopDaemon = proxy.get_dbus_method('StopDaemon', 'apps.nano77.gdm3setup')
+ self.GetGdmMinorVersion()
+
self.load_gtk3_list()
self.load_shell_list()
self.load_icon_list()
@@ -539,6 +543,8 @@ def __init__(self) :
self.ComboBox_gtk.connect("changed",self.gtk3_theme_changed)
self.CheckButton_banner.connect("toggled",self.banner_toggled)
self.Entry_banner_text.connect("changed",self.banner_text_changed)
+ self.CheckButton_banner6.connect("toggled",self.banner_6_toggled)
+ self.Entry_banner_text6.connect("changed",self.banner_text_6_changed)
self.CheckButton_user.connect("toggled",self.user_list_toggled)
self.CheckButton_restart.connect("toggled",self.menu_btn_toggled)
self.Button_autologin.connect("changed",self.autologin_changed)
@@ -569,8 +575,17 @@ def load_shell_list(self):
for i in range(len(lst_shell_themes)):
if os.path.isdir('/usr/share/themes/'+lst_shell_themes[i]+'/gnome-shell') :
- if os.path.isfile('/usr/share/themes/'+lst_shell_themes[i]+'/gnome-shell/gdm.css') :
- self.ComboBox_shell.append_text(lst_shell_themes[i])
+ if self.GdmMinorVersion > 0 and self.GdmMinorVersion < 5 :
+ if os.path.isfile('/usr/share/themes/'+lst_shell_themes[i]+'/gnome-shell/gdm.css') :
+ self.ComboBox_shell.append_text(lst_shell_themes[i])
+ elif self.GdmMinorVersion >= 5 :
+ ofile = open('/usr/share/themes/'+lst_shell_themes[i]+'/gnome-shell/gnome-shell.css','r')
+ lines = ofile.readlines()
+ ofile.close()
+ for line in lines :
+ if line.strip() == ".login-dialog {" :
+ self.ComboBox_shell.append_text(lst_shell_themes[i])
+ break
def load_icon_list(self):
lst_icons = os.listdir('/usr/share/icons')
@@ -623,9 +638,12 @@ def get_gdm(self):
self.Button_shell_logo.set_filename(self.SHELL_LOGO)
self.CheckButton_banner.set_active(self.BANNER)
self.Entry_banner_text.set_text(self.BANNER_TEXT)
+ self.CheckButton_banner6.set_active(self.BANNER)
+ self.Entry_banner_text6.set_text(self.BANNER_TEXT)
self.CheckButton_user.set_active(self.USER_LIST)
self.CheckButton_restart.set_active(self.MENU_BTN)
self.Entry_banner_text.set_sensitive(self.BANNER)
+ self.Entry_banner_text6.set_sensitive(self.BANNER)
self.Button_font.set_font_name(self.FONT_NAME)
self.Switch_clock_date.set_active(self.CLOCK_DATE)
self.Switch_clock_seconds.set_active(self.CLOCK_SECONDS)
@@ -647,12 +665,14 @@ def get_autologin(self):
self.Button_autologin.set_timed(self.AUTOLOGIN_TIMED)
self.Button_autologin.set_time(self.AUTOLOGIN_TIME)
- def AdaptVersion(self) :
+ def GetGdmMinorVersion(self) :
p = subprocess.Popen(GDM_BIN_PATH+" --version",stdout=subprocess.PIPE, shell=True)
- GdmSubVersion = int(p.stdout.read().split(" ")[1].split(".")[1])
+ self.GdmMinorVersion = int(p.stdout.read().split(" ")[1].split(".")[1])
+
+ def AdaptVersion(self) :
GSexists = os.path.exists("/usr/bin/gnome-shell")
- if GdmSubVersion >= 3 :
+ if self.GdmMinorVersion >= 3 :
self.Entry_logo_icon.hide()
self.Builder.get_object("Label_logo_icon").hide()
self.Button_fallback_logo.show()
@@ -662,9 +682,18 @@ def AdaptVersion(self) :
self.Builder.get_object("Label_logo_icon").show()
self.Button_fallback_logo.hide()
self.Builder.get_object("Label_fallback_logo").hide()
- if not GSexists or GdmSubVersion == 0:
+ if not GSexists or self.GdmMinorVersion == 0:
self.Builder.get_object("notebook1").remove_page(1)
+ if self.GdmMinorVersion >= 5 :
+ self.CheckButton_banner.hide()
+ self.Entry_banner_text.hide()
+ else :
+ self.CheckButton_banner6.hide()
+ self.Entry_banner_text6.hide()
+
+
+
def gtk3_theme_changed(self,e):
gtk_theme = unicode(self.ComboBox_gtk.get_active_text(),'UTF_8')
if gtk_theme!=unquote(self.GTK3_THEME) :
@@ -768,6 +797,28 @@ def banner_text_changed(self,e):
else :
self.Entry_banner_text.set_text(self.BANNER_TEXT)
+ def banner_6_toggled(self,e):
+ banner = self.CheckButton_banner6.get_active()
+ if banner!=self.BANNER :
+ if self.set_gdm('BANNER',str(banner).lower()) :
+ self.BANNER = banner
+ print ("Banner Changed : " + str(self.BANNER))
+ if self.BANNER :
+ self.Entry_banner_text6.set_sensitive(True)
+ else:
+ self.Entry_banner_text6.set_sensitive(False)
+ else:
+ self.CheckButton_banner6.set_active(self.BANNER)
+
+ def banner_text_6_changed(self,e):
+ banner_text = unicode(self.Entry_banner_text6.get_text(),'UTF_8')
+ if banner_text!=self.BANNER_TEXT :
+ if self.set_gdm('BANNER_TEXT',banner_text) :
+ self.BANNER_TEXT = banner_text
+ print ("Banner Text Changed : " + self.BANNER_TEXT)
+ else :
+ self.Entry_banner_text6.set_text(self.BANNER_TEXT)
+
def user_list_toggled(self,e):
user_list = self.CheckButton_user.get_active()
if self.USER_LIST != user_list :
View
@@ -78,6 +78,23 @@
<property name="position">3</property>
</packing>
</child>
+ <child>
+ <object class="GtkCheckButton" id="CheckButton_banner6">
+ <property name="label" translatable="yes">Enable Banner</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_action_appearance">False</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">True</property>
@@ -138,6 +155,17 @@
<property name="position">3</property>
</packing>
</child>
+ <child>
+ <object class="EditButton" id="Entry_banner_text6">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>
View
@@ -2,6 +2,11 @@
#
#
+info=$(/usr/sbin/gdm --version)
+Version=$(echo "$info" | cut -d " " -f2)
+SubVersion=$(echo "$Version" | cut -d "." -f2)
+
+
echo -n "GTK=" > /tmp/GET_GDM
gsettings get org.gnome.desktop.interface gtk-theme >> /tmp/GET_GDM
echo -n "ICON=" >> /tmp/GET_GDM
@@ -13,8 +18,12 @@ gsettings get org.gnome.desktop.interface cursor-theme >> /tmp/GET_GDM
echo -n "WALLPAPER=" >> /tmp/GET_GDM
gsettings get org.gnome.desktop.background picture-uri >> /tmp/GET_GDM
echo -n "LOGO_ICON=" >> /tmp/GET_GDM
-gconftool-2 --get /apps/gdm/simple-greeter/logo_icon_name >> /tmp/GET_GDM
+if [ $SubVersion -ge 5 ]
+then
echo >> /tmp/GET_GDM
+else
+gconftool-2 --get /apps/gdm/simple-greeter/logo_icon_name >> /tmp/GET_GDM
+fi
echo -n "FALLBACK_LOGO=" >> /tmp/GET_GDM
gsettings get org.gnome.login-screen fallback-logo >> /tmp/GET_GDM || echo >> /tmp/GET_GDM
echo -n "SHELL_LOGO=" >> /tmp/GET_GDM
@@ -28,8 +37,17 @@ gsettings get org.gnome.login-screen banner-message-enable >> /tmp/GET_GDM || g
echo -n "BANNER_TEXT=" >> /tmp/GET_GDM
gsettings get org.gnome.login-screen banner-message-text >> /tmp/GET_GDM || gconftool-2 --get /apps/gdm/simple-greeter/banner_message_text >> /tmp/GET_GDM
echo -n "CLOCK_DATE=" >> /tmp/GET_GDM
+if [ $SubVersion -ge 5 ]
+then
+gsettings get org.gnome.desktop.interface clock-show-date >> /tmp/GET_GDM
+else
gsettings get org.gnome.shell.clock show-date >> /tmp/GET_GDM
+fi
echo -n "CLOCK_SECONDS=" >> /tmp/GET_GDM
+if [ $SubVersion -ge 5 ]
+then
+gsettings get org.gnome.desktop.interface clock-show-seconds >> /tmp/GET_GDM
+else
gsettings get org.gnome.shell.clock show-seconds >> /tmp/GET_GDM
-
-
+fi
+echo "EOF" >> /tmp/GET_GDM
View
@@ -116,10 +116,12 @@ else
CLOCK_DATE)
echo "$parameter_name = $parameter_value"
gsettings set org.gnome.shell.clock show-date "$parameter_value"
+ gsettings set org.gnome.desktop.interface clock-show-date "$parameter_value"
;;
CLOCK_SECONDS)
echo "$parameter_name = $parameter_value"
gsettings set org.gnome.shell.clock show-seconds "$parameter_value"
+ gsettings set org.gnome.desktop.interface clock-show-seconds "$parameter_value"
;;
*)
echo "Uknown GDM3 Parameter !"

0 comments on commit f53d8cc

Please sign in to comment.