Colorpicker App witthout classic mode

Hello, thank you for the great community! For my application, I use some C++ modules in an Electron app (iohook, robotjs). But when I test my application with snap, the iohook module seem to doesn’t work and crash with this error:


If you want reproduce this error, you can install my app “colorpicker-app” from snap store and click the picker icon.

I’m an amateur on Linux so I don’t really understand the problem. I suppose my app doesnt’ have access to libxkbcommon-x11. So I tested a lot of possibilities like add this package in the stage packages options, but it doesn’t work…

The only solution I found to let work my application is to make using the classic mode. If you can help me to not use this mode, I’ll make the update and remove my request :slight_smile:

Thank you all and have a nice day!

Snaps are a form of application containers and do not have access to most files / libraries on the host system - so you need to ensure all the libraries which are required for your snap to run are packed inside the snap itself - this can be done using the stage-packages directive to specify various packages to be included in the snap - in this case for you would need the libxkbcommon-x11-0 package. See for more info.

You can see my test:

@Toinane is this request for classic confinement still required?

if the required libs are in place , make sure set proper environment variable to add those paths in your launcher script.

Hmm, I’ll try to find how to add in my environnement! I haven’t had time to look into the issue since

For the moment, If we want the picker feature, yeah. Otherwise no. But I’ll take some times to find out how to make this work without classic confinement.

why would that particular feature require classic ? it definitely is not required for i.e. inkscape, gimp or when picking colors from random desktop areas …

am the author of and you can find snapcraft.yaml for it in my github
hope this could help.

1 Like

Yeah I know, I’m new on snapcraft and not really familiar to Linux. for the moment, I know that classic mode can run picker. But yeah I will work on it soon!

Oh thank you! I’m going to check this out for my inspiration, it’s going to help me!

Per Process for reviewing classic confinement snaps, this is not a justification for classic. I suggest starting with confinement: devmode and asking questions in the forum in the ‘snapcraft’ category for help getting your snap to work in strict mode.

Thanks for your link, maybe I was in the wrong category, I was mostly asking for help on how to get over this issue so I wouldn’t have to ask for the classic mode. If it can help, I can close this topic.

It’s now okay for me! After a lot of debug and testing with Electron and natives packages, my application work fine without classic mode! Thanks for the help!

Have a nice day!

1 Like