Skip to content

A script which helps to convert GNU/Linux icon themes to ReactOS/Windows compatible ones

License

Notifications You must be signed in to change notification settings

gonzoMD/IconThemeConverter

Repository files navigation

IconThemeConverter

A Powershell-script which helps to convert GNU/Linux icon themes to ReactOS/Windows compatible ones. To use the script you have to create some definition files, which contain information of the source images and information about the icon properties like size, canvas, overlays(not yet implemented) and more.

Here I will explain step by step how to prepare your computer to use this script and how to write a definition file.

Preparation

3rd-party software

in order to use the script you have to install the following programs:

  • Inkscape: an open source vector graphics editor
  • Imagemagick: a powerful open source graphics editor with excellent command line capabilities.
  • the icon theme of your choice. in this example I'll use Flat Remix

Setting up the script

Save the contents of this repo in a directory of your choice and open the file settings.json within the text editor of your choice. Youl find something like this:

{
    "inkscape": "C:/Program Files/Inkscape/bin/inkscape.exe",
    "convert":"C:/Program Files/ImageMagick-7.0.10-Q16/convert.exe",
    "path_icontheme":"D:/Projects/flat-remix/",
    "path_jsonfiles":"icon_definitions/"
}

The first 2 lines are self explaining. They define the path to the needed executables of Inkscape and Imagemagick Convert. Change them to the full exe path of your installation. The 3rd line contains the path to our source icon theme. Just use the path where you either checked out its repo or where you downloaded and extracted its files to. The last line contains the path to our definition file directory. If no Full path is specified, the directory where the script/settings file is inside, is the base path. In my case I just created a subdirectory called icon_definitions You can create multiple definition files and put them all inside this folder. More about this later. AND YES: These are all slashes and NO backslashes!!! This is important!

Care about Windows like it's a little baby and allow it to execute scripts

windows likes to incapacitate its users by default so we have to do something to be able to run our script

  • Open a powershell window with administrator privileges.
  • enter set-executionpolicy remotesigned
  • confirm with Yes.

Now we installed all software, set the script up and got windows' baby setting in shape. Time to run the script. But wait..... beforehand we have to...

Write the definition file

In this example I'll try to find alternative icons for shell32. I'll use the following pic as orientation: enter image description here We start to use equivalents for the first two icons. Create a json file in the directory, which you specified for the icon definitions before. The name doesn't matter, I called it shell32.json Open it within your favourite text editor and add the following lines:

{
    "name": "shell32",
    "path_out_ico":"/icons",
    "icon": [
        {
            "file_out":"1.ico",
            "file_in":[
                {"size": 16, "src": "Flat-Remix-Yellow/mimetypes/symbolic/text-x-generic-symbolic.svg"},
                {"size": 32, "src": "Flat-Remix-Yellow/mimetypes/scalable/application.svg"},
                {"size": 48, "src": "Flat-Remix-Yellow/mimetypes/scalable/application.svg"}
            ]
        },
        {
            "file_out":"2.ico",
            "file_in":[
                {"size": 16, "src": "Flat-Remix-Yellow/mimetypes/symbolic/x-office-document-symbolic.svg"},
                {"size": 32, "src": "Flat-Remix-Yellow/mimetypes/scalable/application-document.svg"},
                {"size": 48, "src": "Flat-Remix-Yellow/mimetypes/scalable/application-document.svg"}
            ]
        }
    ]
}

to be continued... At least, If you save this file and run the script, it should create 2 icons.

About

A script which helps to convert GNU/Linux icon themes to ReactOS/Windows compatible ones

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published