KanvasBuddy - a Minimalist Toolbar

Got a new button ready for y’all! This one just adds a button that toggles eraser mode to Kanvas Buddy. It should look something like this:

How to install:

  1. Navigate to your kanvasbuddy installation. (Go to Settings → Manage Resources → Open Resource Folder. In that folder, navigate through Pykrita → KanvasBuddy.
  2. Copy the provided config.ini and data.json files into this folder. Replace the existing files. Note: This will get rid of your original settings if you changed them, so you will have to house clean after if you had your own set-up going.

DL Link: https://drive.google.com/drive/folders/15HwhhKrgLz50ufINO4uwBDE7ASKikiro?usp=sharing

Alternatively, you can code it in yourself!
In your data.json, add in:

"eraserMode": {
        "id": "erase_action",
        "icon": "light_edit-delete"
    }

under the “canvasOptions” object. Dont forget a comma before.

In config.ini, add this under canvas options:

eraserMode=1

The place you put this option determines where in kanvasbuddy it ends up.

One final section: It seems possible to make your own canvas actions available for KB as follows:

How to add in a KB action

  • Find the action you want to do.

In the python scripter (tools → scripter), run this:

from krita import *
for i in Krita.instance().actions():
    print(str(i.objectName()), ", " , str(i.text()) )

The output lists actions you can make KB do. Find the action you want to code in by looking through the descriptions after the comma. Once found, you want the phrase before the comma, as that is your action id.

  • Edit data.json

Open data.json and add in something resembling the following template to the object under canvasOptions:

        "<moduleName>": {
        "id": "<the_action_id_from_before>",
        "icon": "<name_of_your_icon>"
    }

The things in <> are what you will change (including the <>). Replace moduleName with anything you want, but remember it as that is what is going into config.ini. Fill in the action id.

For icon, you have to use the name of the Krita gui icon you want to appear. I personally have no clue how to access the list of gui icons like I did with available actions. So far, I’ve just been using the list available from this repository and crossing my fingers! Once you find one, just fill in the icon section and save data.json.

  • Edit config.ini

Open config.ini. Add in the following template under canvasOptions:

<moduleName>=1

is the name you gave your new button back in data.json. Save and restart Krita if open. Reopen Krita and check KanvasBuddy!

Hope this helps!

8 Likes