chikobara / GPU-Switcher-Supergfxctl

GPU Profile switcher Gnome-Shell-Extension for ASUS laptops using Supergfxctl
GNU General Public License v3.0
12 stars 2 forks source link

Header icon is broken #4

Closed ulville closed 4 months ago

ulville commented 4 months ago

Ekran Görüntüsü - 2024-06-29 15-55-17

The icon of the header is broken. It shows image-not-found fallback. graphics-card-symbolic seems to not exist anywhere in the system by default. Maybe you use an icon theme which includes it. It's not a standard icon name I suppose. You should use a standard icon name or supply the icon yourself.

If you have an icon you meant to use which is not available in the Adwaita icon set in /usr/share/icons/Adwaita you should supply it in your extension. Add a directory named icons in the extension's directory and copy your symbolic icon in there. Then you can point to that icon in your code. You can take a look at Caffeine's source code as an example on how to do that.

Basically the setHeader() function also accepts a Gio.Icon object which you can construct by calling Gio.icon_new_for_string(`${path}/icons/<your-icon-name-symbolic>.svg`);. path variable must be passed from the Extension class to the Indicator class in the enable() function. Then from Indicator class to the QuickMenuToggle class.

As a suggestion you can also use this icon from the https://teams.pages.gitlab.gnome.org/Design/icon-development-kit-www/ It's also available from the Icon Library. It's name is pci-card-symbolic

https://github.com/chikobara/GPU-Switcher-Supergfxctl/blob/4dda7ebc4febbcd598de5c601296de9801044b20/extension.js#L55

chikobara commented 4 months ago

Alright thanks for these great informations, also I am not a Gnome-Extension dev but i wanted a tweak like this on Gnome46 so I made one with the help of chatGPT cause the GJS guide was kinda take long, can you give me a guide to on making an icon indicator?

chikobara commented 4 months ago

its fixed now, ty for reporting again if u can give a guide on making icon indicator on the panel (Quicksettings section not in the free area) like caffeine icon indicator.

ulville commented 4 months ago

You mean in here? Where the mouse cursor points resim

If so I'm not sure but there is another extension I use which does that. Maybe you sould take a look at its code to find out. https://extensions.gnome.org/extension/5335/power-profile-indicator/

I'm sure there was something on the GJS Extensions guide for that. Or better if you need further help you should consider joining the Gnome Extensions Matrix room. There will be a lot of friendly people who are willing to help you in there. Most likely much more knowledgeable then myself

chikobara commented 4 months ago

Yep thats what i mean, actually i am trying now to make it

chikobara commented 4 months ago

i think i did it ill update it to gnome store asap thank u for ur information <3