At the moment notion doesn't have any dealings with Xkb so this isn't currently possible. I've recently started (due to some prodding in #ion) to look at an xkb module of mine again and have started to rework it to get it into better (and more generic) shape. I can look into adding this ability there if there are specific things this feature is desired for.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I created a mod_xkbevents git repository which contains a C module that adds xkb related hooks and a lua script to use the bell hooks to notify on xkb bells.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The original usecase was playing a .wav instead of sounding the system beep when the bell is rung.
I tweaked mod_xkbevents a small bit, looks good. One problem is that it calls the 'unsafe' functions 'set_grattr' and 'current'. It is unclear to me what the exact semantics of 'safeness' are, so I don't know whether these functions can be marked 'safe', or that these calls really may cause trouble.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't have all the details on what safe mode is supposed to do but I believe its purpose is to prevent hooked events from changing internal bits of layout/etc. while ion/notion was processing things that may use them (as that could cause things to get very confused). So the set of exposed functions is supposed to, as best I recall/am aware, safe in terms of not changing things.
set_grattr almost certainly isn't safe (though I don't believe it could cause too much harm if exposed) but current probably can be exposed (it might return "incorrect" results as things shift around, so it might not want to be exposed even if it probably can).
Removing the set_grattr calls would render the frame indication portion of the script unusable so they should more likely simply be defered (as some other portions of the script are). I'm surprised though because I think I saw it working in my testing (with an old version of ion3-plus) so I would have expected it to work in notion but who knows.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
At the moment notion doesn't have any dealings with Xkb so this isn't currently possible. I've recently started (due to some prodding in #ion) to look at an xkb module of mine again and have started to rework it to get it into better (and more generic) shape. I can look into adding this ability there if there are specific things this feature is desired for.
I guess the original use case could be sufficiently handled with 'xkbevd', but it might still be interesting to look into
What was the original use case?
I created a mod_xkbevents git repository which contains a C module that adds xkb related hooks and a lua script to use the bell hooks to notify on xkb bells.
The original usecase was playing a .wav instead of sounding the system beep when the bell is rung.
I tweaked mod_xkbevents a small bit, looks good. One problem is that it calls the 'unsafe' functions 'set_grattr' and 'current'. It is unclear to me what the exact semantics of 'safeness' are, so I don't know whether these functions can be marked 'safe', or that these calls really may cause trouble.
Looking at the libextl code, calls to unsafe functions in restricted mode are ignored.
Improved the error message.
We should either mark those functions as 'safe' or remove the calls altogether.
I don't have all the details on what safe mode is supposed to do but I believe its purpose is to prevent hooked events from changing internal bits of layout/etc. while ion/notion was processing things that may use them (as that could cause things to get very confused). So the set of exposed functions is supposed to, as best I recall/am aware, safe in terms of not changing things.
set_grattr almost certainly isn't safe (though I don't believe it could cause too much harm if exposed) but current probably can be exposed (it might return "incorrect" results as things shift around, so it might not want to be exposed even if it probably can).
Removing the set_grattr calls would render the frame indication portion of the script unusable so they should more likely simply be defered (as some other portions of the script are). I'm surprised though because I think I saw it working in my testing (with an old version of ion3-plus) so I would have expected it to work in notion but who knows.