如何开始编写Gnome Shell扩展 [英] How to start writing Gnome Shell extensions

查看:132
本文介绍了如何开始编写Gnome Shell扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现找到有关Gnome Shell Extensions的文档非常困难。我在Gnome Wiki上发现了一些内容(它是第一级链接),但它并不多:

I have found it's very hard to find documentation about Gnome Shell Extensions. I found some bits on Gnome Wiki (and it's first-level links), but it's not much:

http://live.gnome.org/GnomeShell/Extensions

这里的问题是GJS,它是绑定。绝对没有文档,有很多SIGSEGV,绑定还没准备好(GLib,Gio等)。唯一可行的是从GIR为种子JavaScript实现生成的非官方文档:

The problem here is GJS and it's bindings. Absolutely no documentation, got lot's of SIGSEGVs, binding is just not ready (GLib, Gio and others). The only working one is unofficial documentation generated from GIR for Seed JavaScript implementation:

http://roojs.org/seed/gir-1.2-gtk-2.0/seed/

哪里可以获得更多示例?我想要读取目录,文件,生成进程,打开网络套接字以及执行其他操作。

Where to get more examples? I want read directories, files, spawn processes, open network sockets and do other stuff.

更新:演示如何在GJS中逐行读取文件根据谷歌这是不可能的。谢谢。

Update: Show me how to read a file line by line in GJS. According Google this is not possible. Thanks.

推荐答案

GNOME Shell使用 GJS ,而不是种子。它们之间存在一些差异,这可能解释了为什么遇到问题。

GNOME Shell uses GJS, not Seed. There are some differences among both of them, and it might explain why you are having problems.

使用GOBject Introspection,您可以阅读原始库的文档并调整签名每种方法/功能对您使用的语言。

With GOBject Introspection you can read the documentation for the original library and adapt the signature of every method/function to the language you are using.

在您的特定情况下,对于文件,网络等,您可能需要检查 GIO 。您可以查看平台概述以查看其他可用内容。您还可以在 JavaScript 中查看一些示例(不是扩展名)。 。

In your particular case, for files, networking, etc. you might want to check GIO. You can check the Platform Overview to check what else is available. You also can check some examples (not extensions, though) in JavaScript.

最后但并非最不重要的是,很快就会推出一个带扩展名的网站。

At last but not least, very soon a website with extension will be launched.

这篇关于如何开始编写Gnome Shell扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆