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
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 libxkbcommon-x11.so you would need the libxkbcommon-x11-0 package. See https://snapcraft.io/docs/build-and-staging-dependencies for more info.
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 https://snapcraft.io/color-picker when picking colors from random desktop areas …
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!
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!