notekit
notekit copied to clipboard
Feature request: Snippet sub-menu in context menu
Is it possible to add a sub menu to the context menu of the sourceview, that contains more or less short strings defined in the config file. If I click one of the snippets, It should be appended relative to cursor position.
It wouldn't be particularly hard to have a bare-bones implementation, but is it something that's needed in Notekit? Programs like AutoKey provide the same functionality at global/IME scope, and that seems like the more Unix-like way of doing it.
@blackhole89 doubt that'll work on Wayland.
Additionaly I think it makes sense to have it as part of notekit, as the snippets are likely to be notekit/markdown/tex specific.
Yeah, AutoKey apparently doesn't. I did find this writeup of someone spinning their own approach that works with sway (and other wlroots-based compositors?). You could probably modify that to only fire when Notekit is the active window...
After reading (and understanding) this, the obvious limitation is, that Wayland does not allow inputs from an userspace application to input keyevents (libei seems kinda dead in the water). What the author in the writeup does is to copy the snippet into the clipboard using wl-clip. He is using alacritty with a few sway rules to make it look similar to dmenu.
I guess I could write a gnome shell search provider that exposes every snippet as a search result and if invoked copies itself to the clipboard.
Nonetheless I think that It would be a benefit to be able to save a few snippets inside of NoteKit, as (depending on what you are doing) can save a lot of time.
To me, this is just making it sound more like Wayland is not ready for prime time and we should stay with X11 at least until this sort of basic functionality is available and standardised...
Apart from the circumstance that I unfortunately don't have a lot of time to be working on features at the moment, it's still not clear to me how we should go about implementing this if we were going to support it in Notekit. I'm not a big fan of bolting on features in an ad-hoc manner, as those will then become extra weight that needs to be considered when making any far-reaching changes to other parts of the program. It seems that the most appropriate way to support this sort of fairly light-weight but very specific (only a handful of users would need it; a different handful of users might want another feature of this scale, like, I don't know, "convert all spellings between US and UK" or "right-click image to view EXIF metadata") would be to have a scripting facility that presents a clear interface between "core program architecture" and "incidental light-touch features", but that in itself would be a pretty big undertaking with several technical questions that need to be settled...