Is it possible to import the Gvc typelib outside of the Gnome Shell environment?

允我心安 提交于 2019-12-11 00:45:18

问题


I'd like to use Gvc (libgnome-volume-control) as used in Gnome Shell GIR in GJS, but can't find a way to access it except within the Gnome Shell environment (eg. a Gnome Shell extension). Actually, I can't even figure out where it is. Is this possible?

UPDATE

In line with Philip Withnall's comment (about a hacky workaround), I have found it's possible to import like so:

const GIRepository = imports.gi.GIRepository;
GIRepository.Repository.prepend_search_path("/usr/lib/gnome-shell");
GIRepository.Repository.prepend_library_path("/usr/lib/gnome-shell");
const Gvc = imports.gi.Gvc;

回答1:


Yes.

libgnome-volume-control is currently only meant to be used as a submodule. gnome-shell lists it in its .gitmodules file to import the code, and then in meson.build to build it.

It should be possible to use libgnome-volume-control in your project similarly.

(I determined this using git grep -i gvc on the gnome-shell code.)



来源:https://stackoverflow.com/questions/46674935/is-it-possible-to-import-the-gvc-typelib-outside-of-the-gnome-shell-environment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!