This is a easy way to make patches from CSS string.
From firmware 4.x a lot of code moved from libnickel.so.1.0.0 to nickel have been compressed to CSS string.
Tools:
CSS styles modifications inside nickel (Python 2 needed). By pipcat
makepatch program preferable makepatch-0.02.zip file, By GeoffR
Instructions:
- Download thepatch-nickel-css-v02.zip and extract as folder in your PC. Windows users can extract the files extract.bat and patch.bat from "bat files for windows.zip" to that folder.
- Open the file css_streams.py change the line
Code:
pos += 4 + len_stream
to
Code:
pos += 3 + len_stream
That way it can find all CSS streams contained in nickel (Thanks to jackie_w).
- Download the Firmware that you what to make patches from (See here) Extrcat the nickel file from the Kobo firmware kobo-update-4.x.xxxx.zip\koboroot.tgz\usr\local\kobo\nickel, to the folder.
- Execute python extract.py it will make "nickel-extracted.css" file with streams (Windows file extract.bat for easy access). For example in 4.6.9660 there 158 stream with 99 compressed.

- Open the file nickel-extracted.css and select witch stream you want to modify, In this method we work on only one stream at a time.
for example I will show how I made the patch `New home screen increasing cover size` for firmware 4.6.9660. I select the stream 106 and copy it to the file nickel-modified.css, make sure file is empty before.
- I edit the stream in nickel-modified.css file by reduces the left and right margin and save the file.
- I execute python patch.py (Windows file patch.bat for easy access). It will generate a new nickel file with the changes I made in the name "nickel-modif".

- Download makepatch-0.02.zip and extract as folder in your PC. Windows users can extract the file makepa32.bat from "bat files for windows.zip" to that folder.
- I copy the files "nickel" and "nickel-modif" to that folder. Execute the file makepa32 (nickel=oldfile, nickel-modif=newfile). (Windows file makepa32.bat for easy access).
It will create patch `New home screen increasing cover size`.

To copy the patch in windows, right click frame > Edit > Mark, mark the patch, press enter to copy.
- The patch is ready, copy the patch to file nickel.patch.
To make a patch from the same nickel file repeat steps 5-10.