How to make GNOME Icon Theme

Submit your artwork to make Linux Mint look better
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
xwin78
Level 1
Level 1
Posts: 41
Joined: Mon Dec 17, 2007 1:11 am
Location: Mid-West, USA

How to make GNOME Icon Theme

Post by xwin78 »

All,


I have so many cool (IMO) icons and I would like to build an icon set. Are there tools to do this?


Thanks
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
live for what you'd die for
cathbard

Re: How to make GNOME Icon Theme

Post by cathbard »

Not really. I'll tell you how to do it the easiest way I know how and basically how I create my sets. http://cathbard.com/icons.html
First find an iconset that is close to what you want to create. Mostly one that has things that you like that you don't have versions of your own for. Copy this set somewhere in your home folder so you can see all the folders that make up the set. You will find the system wide icons in /usr/share/icons or if you have a set you have downloaded it will probably be an archive that you have to expand. Either way, you will want a copy of this set somewhere in you home folder so you can play with it.
Now go through all these folders to familiarise yourself with what lives where. You will notice that a lot of icons are actually symbollic links to other icons. You can spot these because they have a little arrow attached to them. That means all you have to do is replace the icon that that link points to. To find where it points simply right click on the symbolic link and go into properties and you'll see what the link target is.
You will have to go through all the different folders and replace the icons you want. If you have created your icons with inkscape it is a little easier because you can simply export them in the size you need into each folder by changing the folder destination and export size in the export dialog. Of course you have to know what you are doing. :wink:
Now that you have all your icons in the correct folders it is time to create the set.
First thing to do is rename the parent folder of the set (for example, let's call the set xwin). So rename the parent folder xwin.
Now you have to edit the file called index.theme so gnome knows what to do with your new set. Open this file with gedit and look for the first entry. It will look something like:

[Icon Theme]
Name=Cathbard Mint GTK

change this to

[Icon Theme]
Name=xwin

Save the file.

Gnome handles the installation of new iconsets atrociously. It's one of the areas where kde really kicks gnome's butt. I turn mine into deb packages so people can easily just install them and have them appear in the theme manager when they edit a theme. However I'm not going to tell you how to do that here. For your purposes all you need to do is copy this new set you have created to the ~/.icons folder (~ is shorthand for your user's home folder)
Now when you edit a theme the iconset "xwin" will be available.
If you want to share the set around simply archive it (including the parent folder) as a tar.gz file.

Have fun.
User avatar
akaNed
Level 4
Level 4
Posts: 225
Joined: Mon Aug 20, 2007 10:27 pm
Location: Landrum, SC
Contact:

Re: How to make GNOME Icon Theme

Post by akaNed »

Thanks for the info Cathbard! :D

I've been interested in delving into icons, but it is a bit overwhelming...maybe soon.

Do you have any hints on creating GDM login themes?

Michael
Check out my other wallpapers Deviantart
Follow me at identica or that other one
cathbard

How to make GDM Themes

Post by cathbard »

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.

Screenshot
The screenshot can be taken a few ways but xnest is probably the best method. First you have to install xnest -
sudo apt install xnest
Now just open a terminal and enter:
gdmflexiserver --xnest

The "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.
kanishka
Level 5
Level 5
Posts: 718
Joined: Sat Feb 10, 2007 5:59 am

Re: How to make GNOME Icon Theme

Post by kanishka »

Wow that's so interesting! These HowTOs should go in a wiki or something
User avatar
akaNed
Level 4
Level 4
Posts: 225
Joined: Mon Aug 20, 2007 10:27 pm
Location: Landrum, SC
Contact:

Re: How to make GNOME Icon Theme

Post by akaNed »

kanishka wrote:Wow that's so interesting! These HowTOs should go in a wiki or something
I have to agree :!: Thanks for the wonderful info :D :D :D

Michael
cathbard

Re: How to make GNOME Icon Theme

Post by cathbard »

Thanks, I'm glad you found this interesting but it's a liitle bit scant to be an actual wiki. They are more hacker's hints than wiki's. Maybe if I get a chance to write something more comprehensive I'll create a wiki or a proper howto. Problem is that I'm not a coder, I am a hacker. I don't know xml, I just know how to hack it. :wink:
User avatar
Zwopper
Level 10
Level 10
Posts: 3054
Joined: Fri Nov 30, 2007 12:20 pm
Location: Deep in the Swedish woods
Contact:

Re: How to make GNOME Icon Theme

Post by Zwopper »

...about screenshots...
I recently discovered...

Code: Select all

gdmthemetester console /PATH_TO_UNPACKED_THEME/
Works great! 8)
Then just hit "PrtScn" - and there you go!
Image
My artwork at deviantART | My Band - Electric Alchemea
CREA DIEM!

Lenovo U330P | i5 | 16GB | 128GB - SSD | Elemantary OS 0.4
cathbard

Re: How to make GNOME Icon Theme

Post by cathbard »

Nice find there zwopper.
User avatar
Zwopper
Level 10
Level 10
Posts: 3054
Joined: Fri Nov 30, 2007 12:20 pm
Location: Deep in the Swedish woods
Contact:

Re: How to make GNOME Icon Theme

Post by Zwopper »

cathbard wrote:Nice find there zwopper.
Well you got me started! :wink:
It's all about choices!
Image
My artwork at deviantART | My Band - Electric Alchemea
CREA DIEM!

Lenovo U330P | i5 | 16GB | 128GB - SSD | Elemantary OS 0.4
Locked

Return to “Your Artwork”