Discussion
Loading...

Discussion

Log in
  • Sign up
  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
blinry
blinry
@blinry@chaos.social  ·  activity timestamp 5 days ago

So in trying to figure out why my pavucontrol is missing an icon, I learned a lot about how icon themes work today!

First, it seems that if your system is using dconf, #GTK 4 will only observe the value you see when running:

dconf read /org/gnome/desktop/interface/icon-theme

You can change it using:

dconf write /org/gnome/desktop/interface/icon-theme "'name-of-theme'"

(That's single quotes inside double quotes!)

This even seems to work while the application is running! :O

#gnome

  • Copy link
  • Flag this post
  • Block
blinry
blinry
@blinry@chaos.social replied  ·  activity timestamp 5 days ago

So in trying to figure out why my pavucontrol is missing an icon, I learned a lot about how icon themes work today!

First, it seems that if your system is using dconf, #GTK 4 will only observe the value you see when running:

dconf read /org/gnome/desktop/interface/icon-theme

You can change it using:

dconf write /org/gnome/desktop/interface/icon-theme "'name-of-theme'"

(That's single quotes inside double quotes!)

This even seems to work while the application is running! :O

#gnome

  • Copy link
  • Flag this comment
  • Block
blinry
blinry
@blinry@chaos.social replied  ·  activity timestamp 5 days ago

But where will GTK look for a theme of this name?

The answer is given in the freedesktop.org Icon Theme Specification! https://specifications.freedesktop.org/icon-theme/latest/

It will look in $HOME/.icons, all entries $XDG_DATA_DIRS (in the subdirectory icons/), and in /usr/share/pixmaps/.

It looks for subdirectories of the icon theme name you've set, and merge all contents it finds.

The $XDG_DATA_DIRS mechanism is especially important on #NixOS, because it allows you to dynamically reference the available themes there!

Icon Theme Specification

1 Overview # An icon theme is a set of icons that share a common look and feel. The user can then select the icon theme that they want to use, and all apps use icons from the theme. The initial user of icon themes is the icon field of the desktop file specification, but in the future it can have oth…
  • Copy link
  • Flag this comment
  • Block
blinry
blinry
@blinry@chaos.social replied  ·  activity timestamp 5 days ago

To debug this, you can set an environment variable. If you run:

GTK_DEBUG=icontheme <your-program>

it will print a log of directories it scans, and of available icons. Also, look for the line "Current icon themes" to confirm the correct icon theme was picked. If it says "hicolor", that's the default value, and likely your icon theme is not installed in any of the locations GTK checks!

There's also GTK_DEBUG=iconfallbacks that just prints the missing icons (wasn't super reliable for me?)

  • Copy link
  • Flag this comment
  • Block
blinry
blinry
@blinry@chaos.social replied  ·  activity timestamp 5 days ago

In my case, I had never set any icon theme, so it defaulted to dconf's default value 'Adwaita'.

But I also had never installed the Adwaita icon theme! 😬

Besides the missing "set default" icon in pavucontrol, I also slowly spotted more missing icons in programs I was using.

How many can you find in this screenshot? :D

Three windows (Eye of Gnome, Nautilus, and Evince), with at least 8 missing icons, represented by a "empty page" icon.
Three windows (Eye of Gnome, Nautilus, and Evince), with at least 8 missing icons, represented by a "empty page" icon.
Three windows (Eye of Gnome, Nautilus, and Evince), with at least 8 missing icons, represented by a "empty page" icon.
  • Copy link
  • Flag this comment
  • Block
blinry
blinry
@blinry@chaos.social replied  ·  activity timestamp 5 days ago

And what confused me most: I did have *some* icons! Which icon theme did they belong to?

At some point, I just unset XDG_DATA_DIR, so GTK shouldn't be able to find *any* icon theme!

The icons were still there.

A bit blurry, sure, but I liked them. I got used to them. They look like icons have looked since GNOME 2.

But where did they come from?

Another screenshot of pavucontrol. The icons look a bit cartoon-y, and rather colorful.
Another screenshot of pavucontrol. The icons look a bit cartoon-y, and rather colorful.
Another screenshot of pavucontrol. The icons look a bit cartoon-y, and rather colorful.
  • Copy link
  • Flag this comment
  • Block
blinry
blinry
@blinry@chaos.social replied  ·  activity timestamp 5 days ago

When I unset XDG_DATA_DIR, and run with GTK_DEBUG=icontheme, I spotted these lines:

scanning resource directory /org/gtk/libgtk/icons/16x16/status/

What's that? A resource directory? A bit of searching taught me that the shared library file of GTK4 *contains* some fallback icons! I was able to extract them using

gresource list .../libgtk-4.so

and

gresource extract .../libgtk-4.so /org/gtk/libgtk/icons/16x16/status/audio-volume-muted.png > out.png

This mechanism was quite surprising to me!

  • Copy link
  • Flag this comment
  • Block

Bonfire social

This is a bonfire demo instance for testing purposes

Bonfire social: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.1 no JS en
Automatic federation enabled
Log in Create account
  • Explore
  • About
  • Members
  • Code of Conduct