I have an SVG with multiple layers and I need to generate different png/jpeg files containting all possible combinations of certain layers. Is there a way to do this? I thought it might be possible to do this using the shell command line (I'm using Ubuntu 18.04), by creating a code that first opens the SVG file, shows/hides certain layers and then exports it to png/jpeg, but I don't know how to do this.
I do believe you can achieve this via the command line with the use of Inkscape's actions and verbs. The official documentation on this is a little sparse but I found this page which has more info https://how-to.fandom.com/wiki/How_to_use_Inkscape_in_commandline_mode. If you click on the verb list you can see there's a DeleteLayer verb. You would need to use a scripting language like bash or python to collect a layer list and iterate through the possibilities.