Most of the code is borrowed, JS is not my way, but an extension needs to be created.
Can you tell me how to use g_resolver_lookup_by_name()
to return IP within the given code?
const Main = imports.ui.main;
const St = imports.gi.St;
const GObject = imports.gi.GObject;
const Gio = imports.gi.Gio;
const PanelMenu = imports.ui.panelMenu;
const PopupMenu = imports.ui.popupMenu;
const Me = imports.misc.extensionUtils.getCurrentExtension();
let myPopup;
const MyPopup = GObject.registerClass(
class MyPopup extends PanelMenu.Button {
_init () {
super._init(0);
...
this.menu.addMenuItem(
new PopupMenu.PopupMenuItem(
"Some : ", // IP is required to be returned
{reactive : false},
)
);
}
});
...
Gio.Resolver.lookup_by_name('google.com')
- TypeError: Gio.Resolver.lookup_by_name is not a function