My Gnome Shell extension has a folder 'icons' and there is an icon file called 'MyIcon.png' inside. I want to take it as a parameter to an St.Icon object.
let icon = new St.Icon({ /* I need what to code here*/ });
Thanks for any help.
Selcuk.
Install GNOME Shell Extensions Using GNOME Tweaks ToolHit Alt + F2, type "r", and press Enter. To start Tweaks, click Show Applications in the lower-left corner of the screen. Type "tweaks" in the search box and click the Tweaks icon. Click Extensions in the left pane on the Tweaks dialog box.
Open you Firefox browser and click on the GNOME extension icon. Search for and select an extension you wish to install. Flip the provided switch to install the desired extension.
Local extensions are ones installed by each user in their home directories ( ~/. local/share/gnome-shell/extensions ), whereas system-wide extensions are installed by administrators in system directories ( /usr/share/gnome-shell/extensions/ ).
Here is a solution for GnomeShell v3.8.4:
const St = imports.gi.St;
const Me = imports.misc.extensionUtils.getCurrentExtension();
const Gio = imports.gi.Gio;
let gicon = Gio.icon_new_for_string(Me.path + "/icons/my_icon.png");
icon = new St.Icon({ gicon });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With