Gio.Application quits automatically when it is not in use. For example Gtk.Application (a subclass for graphical applications) is “in use” while there are open windows associated with it.
You can mark the app explicitly as “in-use” by calling application.hold() before the D-Bus call, and application.release() from the result callback.
You shouldn’t use Gio.Application with setting the application-id property. It’s necessary for certain characteristics to work (uniqueness, automatic resources, .desktop file matching in GNOME, …). Those don’t matter here (probably - you haven’t told us what exactly you are trying to do), but best not develop a habit that can bite you later.
The extension works fine but the dbus calls are ugly.
I am trying to make small cli tools (currently considering gjs scripts) which will make the dbus calls. For example, this script might be called get-workspaces.
An extension which will get some data which is now private (Meta, Shell, St …). And few cli tools that will make it easy to make those calls. Just to be clear, I have some functions like:
These do not use the private classes, so these are simple cli tools . I do not put a function in the extension unless it need to use global or any private libraries. I just write simple cli tools for that.
Please let me know if there is a better approach to this.
I know i am only scratching the surface but these tools help some gnome users.
For example, please check some of my answers:
There are other questions (and requirements) like these in the community, however i do not have account in those so i do not respond. However, these sort of issues are everywhere.
Another thing is x11,xdotool, wmctrl… I have done a small survey on “which x11,xdotool/wmctrl… commands i use”. I found that most of them are translatable if i use gnome extension.
This is the problem i am currently trying to solve as i go.