Keeping Krita development install pristine

Hello, I want to test a few things on Krita codebase. But I also use Krita for artistic work. I use Krita-plus appimage for that, and I have many custom brushes, addons and what not. I dont even remember the hacks I have done in my addons to make it pick python/pip addons from several folders.

If I want to hack on Krita codebase itself, I’d like it to use nothing from whatever I added to my default installation. No brushes, no addons, not even UI settings like dockers shown/hidden etc. Picking python from system is fine if it wants to. I tried to find any info regarding this but couldnt.

This is important for me for two purposes. If I add a new feature, I dont want to have an unknown dependency from my system. And secondly and more importantly, I dont want development installs (or my own experiments) to mess something in my default installation. What are the steps I can take to make sure that doesnt happen as much as possible, without resorting to extreme measures like creating a separate user (linux) and ssh -X into it.

For Appimage, if you create a folder next to it with the Appimage name and ‘.home’ appended to it (like krita-5.2.2-x86_64.appimage.home), it will use that to store the config/resources. That could be one solution.

There’s a command line option to set a custom resources directory, for example:

krita --resource-location /tmp/

General settings remain (keyboard shortcuts etc), but brushes, tags, plugins etc are all reset.

The appimage I use for default work, I am fine with whatever it does. Its the development version which I compile from source I want to contain/quarantine. The above post by Rebecca is what I was looking for.

There are several keyboard shortcuts which I have modified from their default action to some action from plugins. You mention keyboard settings remain, but plugins will reset. So the development version will not be able to find the action to which a certain key is set to… and then will it modify the keyboard shortcuts settings for the default installation (eg: setting it from some action to “not-found” or something) ?

You can create an ‘isolated environment’ folder and in that folder you put the appimage file krita-x.y.z and create a folder called krita-x.y.z.home
When the appimage runs, it will use the folder krita-x.y.z.home for its config files and the resources folder.

Try that and you’ll see how it works. Here’s an old example:

Maybe I am understanding it wrong, or I explained differently. The appimage I use for the artistic work, and I want it to keep working as it is, picking things from system wherever it wants.

What I want to isolate is the executable generated after after running cmake and make (or ninja) in the bin folder of the build directory. That is not an appimage file but a plain executable and I am going to use this to experiment with Krita’s codebase, but not artwork. Rebecca’s post is what I am looking for, I just need extra clarification on the behavior of keyboard settings.

1 Like

I honestly don’t know. The keyboard settings are in a separate file in ~/.config/kritashortcutsrc, so you can easily make a copy of that file and try for yourself.

My guess is that the command line options is for specifying a replacement for ~/.local/share/krita/, while it’s still using everything in ~/.config/ that starts with krita.

Oh I see. Thanks. The main reason for me asking this is that I have experience with C++, Qt, Python, PyQt, etc, so I want to learn a bit about the Krita codebase, and to do that, I will inevitably need to break a few things here and there. But I cannot let it interfere with my default installation because I have invested a lot of time configuring it over the years. Yes, some things break sometimes when a new major version is released, which then I fix manually. I think I will take backup of all the folders in ~/.config which has krita in it, just to be sure.

Do it backwards, copy all your configuration into the appimage .home folder, thus whenever you use the appimage it will use those settings. Then the ones put in your .config and .local folder will be your development. Otherwise, the folder stuff are put in are based of whatever your home folder is. So if you make a virtual environment or change the ENV variable, that is where it will go

Well, the problem is my own addons. I dont even remember exactly what I did to make it pickup python libraries which I needed for those addons. And on top of that, I have some hardcoded paths in my addon code. And there are probably many more things which I am forgetting. Which is why I want to leave it as it is if I can.

One thing I did in the past was making a script to run the compiled executable and in it I set the HOME variable to whatever folder I wanted.

But now I use the docker so it is much cleaner and I also don’t have to worry about dependencies being mixed up (os libraries vs official precompiled ones).

1 Like

Yes dockers is an extreme solution. A similar but a bit lighter solution is simply creating another user and run krita there (by forwarding X via ssh).

I’ll try setting HOME variable too. But currently I just compiled the exact same commit which I have appimage of, so simply running it without modifying the code is not likely to do anything which I dont want it to.

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.