Changing the gdm3 login theme

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read this

Re: Changing the gdm3 login theme

Postby oOarthurOo on Tue Dec 07, 2010 3:15 pm

Well, if this last stab at it doesn't reveal anything useful, I'm afraid my attempts to help have come to naught. The only init script that could cause the problems you describe is the mintsystem, and I only say that because I don't know what it is. If you can post the contents of that file, we will determine whether or not I've wasted a lot of your time.

Code: Select all
cat /etc/init.d/mintsystem
oOarthurOo
Level 1
Level 1
 
Posts: 34
Joined: Wed Oct 06, 2010 3:37 pm

Linux Mint is funded by ads and donations.
 

Re: Changing the gdm3 login theme

Postby doktordave on Tue Dec 07, 2010 3:25 pm

Regardless of the outcome, NO time spent learning is a waste. Your efforts are greatly appreciated.

Code: Select all
rose@mars ~ $ cat /etc/init.d/mintsystem
#! /bin/sh

### BEGIN INIT INFO
# Provides:          mintsystem
# Required-Start:    $local_fs $syslog $remote_fs dbus
# Required-Stop:     $local_fs $syslog $remote_fs
# Default-Start:     S
# Default-Stop: 
### END INIT INFO

/usr/lib/linuxmint/mintSystem/mint-adjust.py

User avatar
doktordave
Level 2
Level 2
 
Posts: 60
Joined: Wed Apr 08, 2009 8:57 am
Location: Danville, VA

Re: Changing the gdm3 login theme

Postby oOarthurOo on Tue Dec 07, 2010 4:07 pm

Well, from the LSB headers we can see that it executes roughly at the same time as gdm3, but other than that, all it does is execute a python script. Care to post the output of that script so we can see what it does?

You can either cat it or open it in a text editor.

Code: Select all
/usr/lib/linuxmint/mintSystem/mint-adjust.py
oOarthurOo
Level 1
Level 1
 
Posts: 34
Joined: Wed Oct 06, 2010 3:37 pm

Re: Changing the gdm3 login theme

Postby doktordave on Tue Dec 07, 2010 6:35 pm

Sure, no problem.

Code: Select all
rose@mars ~ $ cat /usr/lib/linuxmint/mintSystem/mint-adjust.py#!/usr/bin/python

import os
import commands
import sys
from time import strftime

# Prepare the log file
global logfile
logfile = open("/var/log/mintsystem.log", "w")

def log (string):
   logfile.writelines("%s - %s\n" % (strftime("%Y-%m-%d %H:%M:%S"), string))
   logfile.flush()

log("minSystem started")

try:
   # Read configuration
   sys.path.append('/usr/lib/linuxmint/common')
   from configobj import ConfigObj
   config = ConfigObj("/etc/linuxmint/mintSystem.conf")
   
   # Default values
   if ('global' not in config):
      config['global'] = {}
   if ('enabled' not in config['global']):
      config['global']['enabled'] = "True"
   if ('restore' not in config):
      config['restore'] = {}
   if ('lsb-release' not in config['restore']):
      config['restore']['lsb-release'] = "True"
   if ('etc-issue' not in config['restore']):
      config['restore']['etc-issue'] = "True"   
   config.write()


   # Exit if disabled
   if (config['global']['enabled'] == "False"):
      log("Disabled - Exited")
      sys.exit(0)

   # Perform file overwriting adjustments
   adjustment_directory = "/etc/linuxmint/adjustments/"
   array_preserves = []
   if os.path.exists(adjustment_directory):
      for filename in os.listdir(adjustment_directory):
             basename, extension = os.path.splitext(filename)
         if extension == ".preserve":
            filehandle = open(adjustment_directory + "/" + filename)
            for line in filehandle:
               line = line.strip()
               array_preserves.append(line)
            filehandle.close()
   overwrites = {}
   if os.path.exists(adjustment_directory):
      for filename in sorted(os.listdir(adjustment_directory)):
             basename, extension = os.path.splitext(filename)
         if extension == ".overwrite":
            filehandle = open(adjustment_directory + "/" + filename)
            for line in filehandle:
               line = line.strip()         
               line_items = line.split()
               if len(line_items) == 2:
                  source, destination = line.split()
                  if destination not in array_preserves:                     
                     overwrites[destination] = source
            filehandle.close()

   for key in overwrites.keys():
      source = overwrites[key]
      destination = key
      if os.path.exists(source):
         if not "*" in destination:
            # Simple destination, do a cp
            if os.path.exists(destination):
               os.system("cp " + source + " " + destination)
               log(destination + " overwritten with " + source)
         else:
            # Wildcard destination, find all possible matching destinations
            matching_destinations = commands.getoutput("find " + destination)
            matching_destinations = matching_destinations.split("\n")
            for matching_destination in matching_destinations:               
               matching_destination = matching_destination.strip()
               if os.path.exists(matching_destination):
                  os.system("cp " + source + " " + matching_destination)
                  log(matching_destination + " overwritten with " + source)      

   # Restore LSB information
   if (config['restore']['lsb-release'] == "True"):
      if os.path.exists("/etc/lsb-release"):
         lsbfile = open("/etc/lsb-release", "w")         
         if (commands.getoutput("grep DISTRIB_ID /etc/linuxmint/info").strip() != ""):
            lsbfile.writelines(commands.getoutput("grep DISTRIB_ID /etc/linuxmint/info") + "\n")
         else:
            lsbfile.writelines("DISTRIB_ID=LinuxMint\n")
         lsbfile.writelines("DISTRIB_" + commands.getoutput("grep \"RELEASE=\" /etc/linuxmint/info") + "\n")
         lsbfile.writelines("DISTRIB_" + commands.getoutput("grep CODENAME /etc/linuxmint/info") + "\n")
         lsbfile.writelines("DISTRIB_" + commands.getoutput("grep DESCRIPTION /etc/linuxmint/info") + "\n")
         lsbfile.close()
         log("/etc/lsb-release overwritten")

   # Restore /etc/issue and /etc/issue.net
   if (config['restore']['etc-issue'] == "True"):
      issue = commands.getoutput("grep DESCRIPTION /etc/linuxmint/info").replace("DESCRIPTION=", "").replace("\"", "")
      if os.path.exists("/etc/issue"):
         issuefile = open("/etc/issue", "w")         
         issuefile.writelines(issue + " \\n \\l")      
         issuefile.close()
         log("/etc/issue overwritten")
      if os.path.exists("/etc/issue.net"):
         issuefile = open("/etc/issue.net", "w")         
         issuefile.writelines(issue)         
         issuefile.close()
         log("/etc/issue.net overwritten")         


except Exception, detail:
   print detail
   log(detail)

log("mintSystem stopped")
logfile.close()

User avatar
doktordave
Level 2
Level 2
 
Posts: 60
Joined: Wed Apr 08, 2009 8:57 am
Location: Danville, VA

Re: Changing the gdm3 login theme

Postby oOarthurOo on Wed Dec 08, 2010 3:38 pm

This is quite the hunt. I wonder how far down the rabbit hole this question will lead us?

So, let’s summarize what we’ve got so far:

There is a proper way to make changes to our gdm3 greeeter, documented and confirmed working by me on a clean debian system. Mint users can also use the documented method to make changes, however, after a system restart the changes are lost and the changes made to the file have been overwritten. Logically, this means that something that only executes on a reboot is responsible, which suggests an init script (you ruled out /etc/rc.local because it doesn’t exist on your system, or if it does, it’s empty), and since the problem doesn’t appear on Debian proper, the most probable place to begin a search is in any Mint changes to the init system.

Coincidentally enough, there is a Mint specific script that does not appear on Debian, and it executes at roughly the same time as the gdm3 script, so it’s a suspect. Unfortunately, all this script does is execute a small piece of python code. So we’ll need to see what this code does. That’s about where our little story left off, yeah?

Before reading any further, there is a pretty simple test we can do to see if we’re even on the right track at all. Edit the mintsystem init script under /etc/init.d and put “exit 0” right above the line where it executes the python script. Then, temporarily move the new file you created (your workaround), and restore the symlink to the original file. Edit that file, as indicated by my first (naïve) post and run the update command. Now reboot. If your changes are still there, we should continue to troubleshoot. If your changes are not, then I am leading us down the completely wrong track and there’s not much point in continuing on it.

Ok, so assuming the test above shows that the mintsystem init script is to blame, we should take a look at what it’s doing. Now, my python is pretty weak, but the great thing about python is that it’s a very clean, very human-readable language, so we should still be able to make some headway. The comments help also. ;)

The first thing to note, is the log file: We should definitely have a look at this if you wouldn’t mind posting it. It’s at /var/log/mintsystem.log

Next the script reads a configuration file, located at /etc/linuxmint/mintSystem.conf
Again, we should take a look at what sort of configuration settings are in here.

Also, this is just a guess, but do an “ls –la” under /usr/lib/linuxmint/commont, because the directory seems to be invovled in providing some of the settings to the configuration code that’s being executed.

Next bit of code relates to “overwriting adjustments”, which sounds kind of ominous. The adjustment director is in /etc/linuxmint/adjustments

No answers yet, but assuming you’ve read this far, I think we’re on to something here. There is a lot of reading and writing and overwriting going on here, though what’s being read at this point is unclear. So, what we need:
1. log file in /var/log/mintsystem.log (especially just after a re-write of the gdm file)
2. contents of /etc/linuxmint/mintSystem.conf
3. file listing of /usr/lib/linuxmint/common
4. file listing of /etc/linuxmint/adjustments

Hope you’re having fun!
oOarthurOo
Level 1
Level 1
 
Posts: 34
Joined: Wed Oct 06, 2010 3:37 pm

Re: Changing the gdm3 login theme

Postby doktordave on Wed Dec 08, 2010 10:41 pm

You are TOO cool. From looking at the mintsystem.log, it looks like it is the adjustments that are doing the overwrites. But I don't want to get ahead of myself, so here is the info you asked for.

Doing the test you suggested kept my changes. Continuing on, I had a look at mintsystem.log, and it does show several overwrites, including the one to the greeter.gconf-defaults.

mintsystem.log (after re-write of the gdm file, and invoke-rc.d gdm3 reload):

Code: Select all
rose@mars /var/log $ cat mintsystem.log
2010-12-08 20:57:07 - minSystem started
2010-12-08 20:57:07 - /opt/firefox/searchplugins/yahoo.xml overwritten with /usr/share/linuxmint/adjustments/firefox/yahoo.xml
2010-12-08 20:57:07 - /opt/firefox/defaults/profile/mimeTypes.rdf overwritten with /usr/share/linuxmint/adjustments/firefox/mimeTypes.rdf
2010-12-08 20:57:07 - /opt/firefox/browserconfig.properties overwritten with /usr/share/linuxmint/adjustments/firefox/browserconfig.properties
2010-12-08 20:57:08 - /usr/share/synaptic/glade/window_main.glade overwritten with /usr/lib/linuxmint/mintSystem/adjustments/synaptic.glade
2010-12-08 20:57:08 - /opt/firefox/defaults/profile/bookmarks.html overwritten with /usr/share/linuxmint/adjustments/firefox/bookmarks.html
2010-12-08 20:57:08 - /opt/firefox/defaults/pref/firefox-branding.js overwritten with /usr/share/linuxmint/adjustments/firefox/firefox.js
2010-12-08 20:57:08 - /etc/gdm3/greeter.gconf-defaults overwritten with /usr/share/linuxmint/adjustments/gdm3/greeter.gconf-defaults
2010-12-08 20:57:08 - /opt/firefox/searchplugins/google.xml overwritten with /usr/share/linuxmint/adjustments/firefox/google.xml
2010-12-08 20:57:08 - /etc/lsb-release overwritten
2010-12-08 20:57:08 - /etc/issue overwritten
2010-12-08 20:57:08 - /etc/issue.net overwritten
2010-12-08 20:57:08 - mintSystem stopped


mintSystem.conf:

Code: Select all
rose@mars /etc/linuxmint $ cat mintSystem.conf
[global]
enabled = True
[restore]
lsb-release = True
etc-issue = True


/usr/lib/linuxmint/common listing:

Code: Select all
rose@mars /usr/lib/linuxmint/common $ ls
configobj.py   launch_browser_as.py  mint-which-launcher.py
configobj.pyc  launch_browser.sh     version.py


/etc/linuxmint/adjustments listing:

Code: Select all
rose@mars /etc/linuxmint/adjustments $ ls
10-mintsystem-synaptic.overwrite  15-gdm3.overwrite         15-opera.overwrite
15-firefox.overwrite              15-gnome-sound.overwrite  README


and the contents of 15-gdm3.overwrite (No surprise here):

Code: Select all
/usr/share/linuxmint/adjustments/gdm3/greeter.gconf-defaults /etc/gdm3/greeter.gconf-defaults


Moving that file out of the adjustments directory results in my changes staying put. Since I don't know what else may be happening, I'm not sure if this is the right fix, but it's looking good at the moment.

Now, what am I missing here? I would not be surprised to find that I'm overlooking something.

And yes, in a way I have to say this is fun, at least I'm learning somewhat about my system. I've enjoyed the ride so far, hopefully when squeeze goes stable, I won't be too overwhelmed by the updates. As another poster put it, this is what I've been looking for all along. Getting the machine to do what I want it to do is quite satisfying. I'd never have gotten this far toward sorting it out without your help.
User avatar
doktordave
Level 2
Level 2
 
Posts: 60
Joined: Wed Apr 08, 2009 8:57 am
Location: Danville, VA

Re: Changing the gdm3 login theme

Postby oOarthurOo on Sat Dec 11, 2010 10:32 am

Hey, nice job. Now we know where Mint users have to make their changes if they want them to persist. You moved the file out of there, which is ok, but probably not the best idea. I only say that, because I have to assume the Mint devs had *some* reason for overwriting a bunch of config files at every boot, though what that could be is quite beyond me. You might find a clue in the README file located in /etc/linuxmint/adjustments.

For now, my best guess is that the Minty way to edit your gdm, would be to make changes the normal debian way as decribed in my first post, then change enabled to False in /etc/linuxmint/mintSystem.conf
[global]
enabled = False

Although, I'd be more inclined myself to disable the gdm file in adjustments, or make my changes there.

It's been a pleasure troubleshooting with you.

Best,
AM
oOarthurOo
Level 1
Level 1
 
Posts: 34
Joined: Wed Oct 06, 2010 3:37 pm

Re: Changing the gdm3 login theme

Postby ShexNivis on Sat Dec 11, 2010 2:07 pm

I haven't been following this post closely but...
Did you guys notice that testing now(since a few days) uses a package called desktop-base(6.0.2) to manage things like this?
Just saying in case this changes something for what you guys were trying to do.

README:
Code: Select all
cat /usr/share/doc/desktop-base/README.Debian
README for desktop-base
=======================

1. Images
   1.1. Emblems
   1.2. Pixmaps
   1.3. Splash and Wallpapers
   1.4. Boot splash
2. Desktop files
3. Changing desktop-base images
4. Window Managers

1. Images

1.1. Emblems
/usr/share/icons/hicolor/48x48/emblems/emblem-debian.png
/usr/share/icons/hicolor/48x48/emblems/emblem-debian.icon

1.2. Pixmaps
/usr/share/pixmaps/debian-security.png

1.3.  Splash, wallpapers and grub images

Wallpapers are provided in two svg variant, one standard aspect (4/3) and one
widescreen (16/9). You can switch from one another using the alternatives.
Using the same system you can select one of the older theme variant. Beware
that changing alternative means at the next package upgrade it won't be
automatically reverted to the default choice.

For wallpaper you can run:

  sudo update-alternatives --config desktop-background

For splash screens you can run:

  sudo update-alternatives --config desktop-splash

For grub, you can select standard or widescreen version too, using:

  sudo update-alternatives --config desktop-grub

2. Desktop files

/usr/share/desktop-base/debian-homepage.desktop
/usr/share/desktop-base/debian-reference.desktop
/usr/share/desktop-base/debian-security.desktop

3. Changing desktop-base images

We need professional looking Debian artwork in the
Desktop. If you want to help changing some desktop-base
images, that would be good consider the following notes:

- The swirl Debian logo is red;
- The Debian font is Poppl Laudation Condensed (unfortunately,
  commercial font)
- Blue (#5F92C9 and some others) fits with GNOME default
  clearlooks theme that we use in your default desktop
  environment and looks good in KDE too;
- Black and White are welcome colors too.

If you've suggestions for a better artwork, create or edit
the images and open a 'wishlist' bug against desktop-base in our
Bug Tracking System (http://bugs.debian.org/). Please attach the
'svg' or 'xcf' and don't violate copyright.

4. Window Managers
desktop-base is used by GNOME/KDE/Xfce.

If you're responsible for a WM in Debian and wants to use
desktop-base artwork or add your own image (wallpaper, splash,
whatever) use the layout described above and send your patch
through the Bug Tracking System to us.
best torrent client ever: http://www.tixati.com
User avatar
ShexNivis
Level 3
Level 3
 
Posts: 109
Joined: Mon Sep 21, 2009 10:25 pm

Re: Changing the gdm3 login theme

Postby doktordave on Sat Dec 11, 2010 3:39 pm

Thanks for the info.
User avatar
doktordave
Level 2
Level 2
 
Posts: 60
Joined: Wed Apr 08, 2009 8:57 am
Location: Danville, VA

Re: Changing the gdm3 login theme

Postby CiaW on Sat Dec 11, 2010 4:42 pm

When the new package (desktop-base) was installing it asked about replacing configuration file '/etc/gdm3/greeter.gconf-defaults, and after looking at the differences (if I was reading it correctly) I opted to keep the current file and not have it replaced. It looked like it wanted to replace the Mint-X theme with Clearlooks, which was my biggest reason for having it not replace the previous file.

Otherwise I'm not a huge fan of the new Mint 10 gdm greeter screen but I only see it for a few seconds while I'm logging in, so as long as it gets me to my desktop I'll only worry about changing it if it's something truly awful.

In case anyone wants to see what the differences are, I copied it down:

Code: Select all
--- /etc/gdm3/greeter.gconf-defaults   2010-12-10 16:22:09.332256236 +0000
+++ /etc/gdm3/greeter.gconf-defaults.dpkg-new   2010-11-14 10:22:12.000000000 +0000
@@ -1,13 +1,15 @@
 # Use a specific background
-/desktop/gnome/background/picture_filename   /usr/share/backgrounds/linuxmint/default_background.jpg
-/desktop/gnome/background/picture_options   stretched
+#/desktop/gnome/background/picture_filename   /usr/share/images/desktop-base/login-background.svg
+#/desktop/gnome/background/picture_options   zoom
 
 # Theming options
-/desktop/gnome/interface/gtk_theme      Mint-X
-#/desktop/gnome/interface/icon_theme      Mint-X
+#/desktop/gnome/interface/gtk_theme      Clearlooks
 
 # Greeter options
-#/apps/gdm/simple-greeter/logo_icon_name    debian-swirl
+/apps/gdm/simple-greeter/logo_icon_name    debian-swirl
+
+# Play system beeps - especially the one when the greeter is ready
+/desktop/gnome/sound/event_sounds      true
 
 # Some other possible options
 #/apps/gdm/simple-greeter/banner_message_enable      true
@@ -18,3 +20,5 @@
 # The lower panel doesn't work with the compositor
 /apps/metacity/general/compositing_manager      false
 
+# Prevent the power management icon from showing up
+/apps/gnome-power-manager/ui/icon_policy      neve
r
CiaW
Level 3
Level 3
 
Posts: 170
Joined: Fri Sep 10, 2010 11:39 am
Location: Spokane Wash, USA

Re: Changing the gdm3 login theme

Postby oOarthurOo on Sat Dec 11, 2010 5:06 pm

It's probably the reason Mint dev's run the mintsystem script. Installing desktop-base would've set gdm to the new Spacefun theme. If you'd said yes and let it switch, on next reboot the mint init script would've restored it to default Mint.
oOarthurOo
Level 1
Level 1
 
Posts: 34
Joined: Wed Oct 06, 2010 3:37 pm

Re: Changing the gdm3 login theme

Postby mads on Tue Dec 21, 2010 10:42 pm

The contents of

Code: Select all
/etc/gdm3/greeter.gconf-defaults

is replaced/overwritten by

Code: Select all
/usr/share/linuxmint/adjustments/gdm3/greeter.gconf-defaults

on every restart.
User avatar
mads
Level 6
Level 6
 
Posts: 1302
Joined: Wed Nov 03, 2010 3:44 pm

Re: Changing the gdm3 login theme

Postby RHTopics on Fri Jan 07, 2011 4:50 pm

I made my changes to the gdm3 login theme permanent by creating the file:

Code: Select all
/etc/linuxmint/adjustments/15-gdm3.preserve

This text file contains just the following line:

Code: Select all
/etc/gdm3/greeter.gconf-defaults


You will need to use sudo or root privileges to create and edit the file.
RHTopics
Level 1
Level 1
 
Posts: 34
Joined: Fri Sep 10, 2010 2:32 pm

Re: Changing the gdm3 login theme

Postby mads on Fri Jan 07, 2011 6:37 pm

RHTopics wrote:I made my changes to the gdm3 login theme permanent by creating the file:

Code: Select all
/etc/linuxmint/adjustments/15-gdm3.preserve

This text file contains just the following line:

Code: Select all
/etc/gdm3/greeter.gconf-defaults


You will need to use sudo or root privileges to create and edit the file.

Very smart approach. "15-gdm3.overwrite" is there from before, but .preserve files are read first. Excellent!
User avatar
mads
Level 6
Level 6
 
Posts: 1302
Joined: Wed Nov 03, 2010 3:44 pm

Re: Changing the gdm3 login theme

Postby RHTopics on Fri Jan 07, 2011 7:59 pm

Very smart approach. "15-gdm3.overwrite" is there from before, but .preserve files are read first. Excellent!

Thanks, it is nice to have the gdm3 login screen theme and wallpaper match with the desktop theme and wallpaper.
RHTopics
Level 1
Level 1
 
Posts: 34
Joined: Fri Sep 10, 2010 2:32 pm

Re: Changing the gdm3 login theme

Postby dawgdoc on Wed Jan 12, 2011 7:03 pm

mads wrote:
Code: Select all
/etc/gdm3/greeter.gconf-defaults

is replaced/overwritten by

Code: Select all
/usr/share/linuxmint/adjustments/gdm3/greeter.gconf-defaults

on every restart.


Since editing /etc/gdm3/greeter.gconf-defaults does not work, out of curiosity I tried editing /usr/share/linuxmint/adjustments/gdm3/greeter.gconf-defaults. Changing where this file points has successfully changed my desktop behind the log-in applet. It has held for several reboots.
Image

SYSTEM: Compaq Presario CQ62 Dual-Boot: Mint 13 Gnome x32 PAE, LMDE
READING: The Autobiography of Benvenuto Cellini
User avatar
dawgdoc
Level 9
Level 9
 
Posts: 2686
Joined: Mon Oct 05, 2009 12:53 am
Location: Kentucky, USA the land of Mint Juleps

Re: Changing the gdm3 login theme

Postby jazzcat on Sat Apr 28, 2012 2:59 am

Great thread guys, it's resources like this that help users like myself who are trying out LMDE for the first time (moving over from mint 12 KDE). Thank you ^_^
jazzcat
Level 1
Level 1
 
Posts: 11
Joined: Sat Feb 04, 2012 8:50 pm

Linux Mint is funded by ads and donations.
 
Previous

Return to Newbie Questions

Who is online

Users browsing this forum: No registered users and 2 guests