Can I use Gtk.ShortcutsShortcut in my extension

Hi, for my shortcuts popup extension I would like to use ShortcutsShortcut and ShortcutsGroup and set them up programmatically. I this possible? I read somewhere I cannot use any GTK widgets in extension.js

I suppose, a gnome-shell extension, do you mean?

I read somewhere I cannot use any GTK widgets in extension.js

That is correct.

In order to be shown, a GTK widget must be inside a toplevel like GtkWindow, and you cannot show a GtkWindow from within the window manager / compositor.

You can either provide the GTK UI in the extension preferences, or you can write a small GTK program that your extension can launch.

1 Like

Thanks. I’ll go for the small GTK program that my extension can launch.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.