Again, the way I do it is to hack. Nowdays I am hacking my own things so they are hacks of hacks and are pretty much unrecognisable from the original. WHether they are GDM or KDM the process is the same, the code for both is very similar. Take one that is close to what you have in mind and replace all the components and then hack the greeter and the xml.
The first thing to do is hack the greeter. It will look something like this:
- Code: Select all
[GdmGreeterTheme]
Greeter=mint-buntuleaves.xml
Name=Mint Buntuleaves
Description=Mint Buntuleaves gdm
Author=Cathbard <cathbard@gmail.com>
Copyright=(c) 2008 GPL2 Cathbard
Screenshot=screenshot.png
Edit it to suit the one you are creating. You will see the definition for the xml file in there. That is the file where everything happens.
The xml code will be broken up into nested sections that will begin with something like <item> and end with a </item>. Each section should have tab delimitors so they line up. For example, the section that defines the timed login section would look like this:
- Code: Select all
<item type="rect" id="timed-rect">
<show type="timed"/>
<normal color="#FFFFFF" alpha="0.5"/>
<pos anchor="c" x="50%" y="75%" width="box" height="box"/>
<box orientation="vertical" min-width="400" xpadding="10" ypadding="5" spacing="0">
<item type="label" id="timed-label">
<normal color="#000000" font="Sans 14"/>
<pos x="50%" anchor="n"/>
<stock type="timed-label"/>
</item>
</box>
</item>
The outside section (first and last) defines the rectangle that everything is referenced to and within that are sections that define where inside that rectangle the timer lives and how it looks. You will often see these coordinates in absolute terms. (ie <pos anchor="c" x="200" y="100" width="box" height="box"/>) This is not a good thing to do because the relative positions will change depending on the resolution used by the user. I convert all these figures into relative %'s as you can see in my example. This way everything will always be where you want them to be.
The position locaters are taken from the left (x) and the top (y)
There are a couple of ways to test what you are doing along the way but with gnome I find the easiest way is to rename the parent folder of the theme you are working on (once you have replaced all the images and edited your greeter) and copy the whole lot to /usr/share/gdm/themes.
You can then simply select the new theme in "Administration > Login Window > Local" and just go to "Logout > switch User" from the menu and then exit once you see what it looks like. Just be aware that there is an extra icon called quit when you go to switch user so try to take that into account. You can also do this with xnest (see below in the screenshot section)
Now just open the xml file in /usr/share/gdm/themes/newgdm with "gksu gedit" and start hacking until it is all sorted how you like it.
What I do is adjust the entire sections (the defined rectangles) so they are where I want them to be and then make fine adjustments with the location of the individual elements once the rectangle is in the correct place. You can change the alpha (transparency) while doing this so you can see the actual rectangle easily and then change it to the desired value once you have it in position.
ScreenshotThe screenshot can be taken a few ways but xnest is probably the best method. First you have to install xnest -
sudo apt install xnestNow just open a terminal and enter:
gdmflexiserver --xnestThe "gdmflexiserver --xnest" item is actually in the system tools menu (which will appear in "administration" in mintMenu) as "New Login In a Window" but it is unchecked so you need to go into the menu editor and turn it on.
Hit the "print scr" key on your keyboard and take the screeny. Edit it with gimp and stick it the theme folder.
Now all you need to do is archive the new theme you have created (including the parent folder) as a tar.gz and bada bing bada boom - all done!
Enjoy.