Gnome JavaScript 文档
我正在尝试深入 Gnome shell 扩展开发,但目前我有点困惑。 我似乎找不到有关 GJS 库的正确文档。例如,我想至少知道哪些导入可用以及类的成员/方法,否则我只能依赖现有的扩展代码,而不是太多。
有人能引导我走向正确的方向吗?
提前致谢。
I'm trying to dive into Gnome shell extensions development but I'm a little bit confused at the moment.
I can't seem to find a proper documentation about GJS library. For example I want to know at least what imports are available and members/method of classes without that I can only rely on existing extensions code, not too much.
Can anyone lead me in the right direction?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要开始编写 GNOME Shell 扩展,我建议您开始查看 Shell 扩展 wiki 页面。在那里您可以找到教程和指南的链接。
对于可用的模块,您可以通过 GObject Instrospection 获得所有可用的内容。为了熟悉这一点,您可以查看解释的演示。有关 API 文档,您可以访问平台概述。
To start writing GNOME Shell Extensions, I would recommend you to start looking the Shell Extensions wiki page. There you will find links to tutorials, as well as guidelines.
With respect to modules available, you have everything that is available via GObject Instrospection. In order to get familiar with this, you can take a look the explained demos. For API docuementation, you can go to Platform Overview.
我自己不是专家,但根据我修补扩展的经验,大多数实用程序都基于 Clutter,其中 GObject Introspection 将 API 公开给 JavaScript。不幸的是我找不到 shell 本身的 API 文档。我能得到的最接近的是位于
/usr/share/gnome-shell/js/
的 shell 的 JavaScript,这(对我来说)已经足够了,因为扩展可能会在运行时修改 JavaScript 对象,而不是调用它的函数。Not an expert myself, but based on my experience patching an extension, most of the utility are based on Clutter in which GObject Introspection expose the API to JavaScript. Unfortunately I cannot find the API documentation for the shell itself. The closest I can get is the JavaScript for the shell at
/usr/share/gnome-shell/js/
which (for me) is quite enough as an extension would probably modify JavaScript object at runtime rather than calling it's function.