How-to Guide: Convert any GDM theme to MDM

Write tutorials here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Do not start a support topic here please. Before you post please read this

How-to Guide: Convert any GDM theme to MDM

Postby twodogs on Thu Nov 22, 2012 12:01 am

In Linux Mint 14, MDM is compatible with GDM 2 themes. This tutorial is for Mint 13 and older.

I use(d) a script to convert any GDM theme to a MDM theme. Works great!

Copy the code and save as a shell script (ex: Convert GDM theme to MDM.sh). Put the script in /home/username/.gnome2/nautilus-scripts or nemo-scripts and make sure it is checked as 'executable.'

Download a GDM theme and run this script on the downloaded file by right clicking, navigating to >scripts>Convert GDM theme to MDM.

Code: Select all
    #!/usr/bin/env python

    # Convert GDM theme to MDM by esteban1uy
    import pygtk
    import tarfile
    import os
    import sys
    import tempfile
    import gtk

    pygtk.require('2.0')

    if gtk.pygtk_version < (2,3,90):
       raise SystemExit
    def look_in_directory(directory):
        for f in os.listdir(directory):
            if os.path.isfile(os.path.join(directory, f)):
                if f == "GdmGreeterTheme.desktop":
                    return os.path.join(directory, f)
            if os.path.isdir(os.path.join(directory, f)):
                if look_in_directory(os.path.join(directory, f)) != "":
                    return os.path.join(directory, f)

    dialog = gtk.FileChooserDialog("Select theme file",
                                   None,
                                   gtk.FILE_CHOOSER_ACTION_OPEN,
                                   (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
                                    gtk.STOCK_OPEN, gtk.RESPONSE_OK))
    dialog.set_default_response(gtk.RESPONSE_OK)

    filter = gtk.FileFilter()
    filter.set_name("All files")
    filter.add_pattern("*.tar.gz")
    dialog.add_filter(filter)

    response = dialog.run()
    if response == gtk.RESPONSE_OK:
        fullpathToTar = dialog.get_filename()
        fullpath = os.path.dirname(fullpathToTar)
        tar = tarfile.open(fullpathToTar, "r:gz")
        destinationPath = tempfile.mkdtemp() + "/"
        tar.extractall(destinationPath)
        GdmFile = look_in_directory(destinationPath)
        if GdmFile != "":
            o = open(GdmFile+"/MdmGreeterTheme.desktop","a")
            for line in open(GdmFile+"/GdmGreeterTheme.desktop"):
                 line = line.replace("GdmGreeterTheme","MdmGreeterTheme")
                 o.write(line)
            o.close()
            innerfolder = os.path.split(os.path.dirname(GdmFile+"/"))[1]
            newtar = tarfile.open(fullpath + "/"+innerfolder+"_for_MDM.tar.gz", "w:gz")
            newtar.add(GdmFile+"/",innerfolder+"/")         
            newtar.close()
    elif response == gtk.RESPONSE_CANCEL:
        exit()
    dialog.destroy()


You can also download the shell script.

The script can be used on LMDE and KDE with Thunar as a file manager. If you know a way to use it in Dolphin, please tell how.

Images by GeneC.

Image

Image

Enjoy!
--
Image
Lenovo laptop B575 8 gigs memory, 750 hard drive, and Linux Mint 17 Qiana Cinnamon 64-bit
User avatar
twodogs
Level 4
Level 4
 
Posts: 265
Joined: Sat Jun 09, 2007 9:18 pm

Linux Mint is funded by ads and donations.
 

Re: How-to Guide: Convert any GDM theme to MDM

Postby GeneC on Thu Nov 22, 2012 9:30 am

Hi again Twodogs..

Just wanted to say THANKS again for this.
It works brilliantly.. :D

Download themes from here.
http://gnome-look.org/index.php?xcontentmode=150

A couple clicks in file manager converts them from GDM to MDM, simple and elegant.. :wink:
GeneC

AMD Phenom2x4 3.2 ghz, 12GB DDR3, Nvidia GTX 460

Qiana (Cinnamon)
Sparky XFCE (Debian Testing)
Sparky Gnome 3.14 (SID)
EvolveOS (Budgie)
User avatar
GeneC
Level 7
Level 7
 
Posts: 1565
Joined: Fri Sep 03, 2010 1:59 pm
Location: Maine, USA

Re: How-to Guide: Convert any GDM theme to MDM

Postby twodogs on Thu Nov 22, 2012 10:11 am

GeneC wrote:Hi again Twodogs..

Just wanted to say THANKS again for this.
It works brilliantly.. :D

Download themes from here.
http://gnome-look.org/index.php?xcontentmode=150

A couple clicks in file manager converts them from GDM to MDM, simple and elegant.. :wink:


Your welcome, GeneC. I didn't write this script, just found it and made it more available. I, too, was surprised
how good it works. Have a great day!
--
Image
Lenovo laptop B575 8 gigs memory, 750 hard drive, and Linux Mint 17 Qiana Cinnamon 64-bit
User avatar
twodogs
Level 4
Level 4
 
Posts: 265
Joined: Sat Jun 09, 2007 9:18 pm

Re: How-to Guide: Convert any GDM theme to MDM

Postby bimsebasse on Thu Nov 22, 2012 10:14 am

Thank you for this thread. That’s all I can say. You most definitely have made this forum into something special. You clearly know what you are doing, you’ve covered so many bases. Thanks!
User avatar
bimsebasse
Level 7
Level 7
 
Posts: 1709
Joined: Fri Nov 11, 2011 10:21 am
Location: Scandinavia

Re: How-to Guide: Convert any GDM theme to MDM

Postby twodogs on Thu Nov 22, 2012 10:35 am



Holy cow! I could not remember where I had found this script and even searched but did not find it. Good find bimsebasse and a very useful script.
--
Image
Lenovo laptop B575 8 gigs memory, 750 hard drive, and Linux Mint 17 Qiana Cinnamon 64-bit
User avatar
twodogs
Level 4
Level 4
 
Posts: 265
Joined: Sat Jun 09, 2007 9:18 pm


Return to Tutorials

Who is online

Users browsing this forum: No registered users and 11 guests