5

When I start okular from the terminal, I get a bunch of "Invalid Context" warnings about certain icon theme folders (both from Yaru, which is the theme set in Gnome Tweaks, and Adwaita). Editing the index.theme for the named directories to be excluded erases the warnings, but then breaks some of the UI (The little arrows in the top bar settings become crossed-circle forbidden icons), which I guess is to be expected.

Googling shows that this happened to a lot of people on a variety of apps, but solutions I found were not applicable (app-specific or for Arch).

Okular seems to work fine. I recently upgraded to 20.4 from 19.10, but the error existed before that, as well.

Does anyone know why I am getting these warnings or how to fix them?

full command-line output:

Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
Invalid Context= "Legacy" line for icon theme:  "/usr/share/icons/Yaru/16x16/legacy/"
Invalid Context= "Legacy" line for icon theme:  "/usr/share/icons/Yaru/22x22/legacy/"
Invalid Context= "Legacy" line for icon theme:  "/usr/share/icons/Yaru/24x24/legacy/"
Invalid Context= "Legacy" line for icon theme:  "/usr/share/icons/Yaru/32x32/legacy/"
Invalid Context= "Legacy" line for icon theme:  "/usr/share/icons/Yaru/48x48/legacy/"
Invalid Context= "Apps" line for icon theme:  "/usr/share/icons/Yaru/256x256@2x/apps/"
Invalid Context= "Mimetypes" line for icon theme:  "/usr/share/icons/Yaru/256x256@2x/mimetypes/"
Invalid Context= "Mimetypes" line for icon theme:  "/usr/share/icons/Yaru/scalable/mimetypes/"
Invalid Context= "Legacy" line for icon theme:  "/usr/share/icons/Adwaita/8x8/legacy/"
Invalid Context= "Legacy" line for icon theme:  "/usr/share/icons/Adwaita/16x16/legacy/"
Invalid Context= "UI" line for icon theme:  "/usr/share/icons/Adwaita/16x16/ui/"
Invalid Context= "Legacy" line for icon theme:  "/usr/share/icons/Adwaita/22x22/legacy/"
Invalid Context= "Legacy" line for icon theme:  "/usr/share/icons/Adwaita/24x24/legacy/"
Invalid Context= "UI" line for icon theme:  "/usr/share/icons/Adwaita/24x24/ui/"
Invalid Context= "Legacy" line for icon theme:  "/usr/share/icons/Adwaita/32x32/legacy/"
Invalid Context= "UI" line for icon theme:  "/usr/share/icons/Adwaita/32x32/ui/"
Invalid Context= "Legacy" line for icon theme:  "/usr/share/icons/Adwaita/48x48/legacy/"
Invalid Context= "UI" line for icon theme:  "/usr/share/icons/Adwaita/48x48/ui/"
Invalid Context= "Legacy" line for icon theme:  "/usr/share/icons/Adwaita/64x64/legacy/"
Invalid Context= "UI" line for icon theme:  "/usr/share/icons/Adwaita/64x64/ui/"
Invalid Context= "Legacy" line for icon theme:  "/usr/share/icons/Adwaita/96x96/legacy/"
Invalid Context= "UI" line for icon theme:  "/usr/share/icons/Adwaita/96x96/ui/"
Invalid Context= "Legacy" line for icon theme:  "/usr/share/icons/Adwaita/256x256/legacy/"
Invalid Context= "Legacy" line for icon theme:  "/usr/share/icons/Adwaita/512x512/legacy/"
Invalid Context= "Legacy" line for icon theme:  "/usr/share/icons/Adwaita/scalable/legacy/"
Invalid Context= "UI" line for icon theme:  "/usr/share/icons/Adwaita/scalable/ui/"
Invalid Context= "Legacy" line for icon theme:  "/usr/share/icons/Yaru/16x16/legacy/"
Invalid Context= "Legacy" line for icon theme:  "/usr/share/icons/Yaru/22x22/legacy/"
Invalid Context= "Legacy" line for icon theme:  "/usr/share/icons/Yaru/24x24/legacy/"
Invalid Context= "Legacy" line for icon theme:  "/usr/share/icons/Yaru/32x32/legacy/"
Invalid Context= "Legacy" line for icon theme:  "/usr/share/icons/Yaru/48x48/legacy/"
Invalid Context= "Apps" line for icon theme:  "/usr/share/icons/Yaru/256x256@2x/apps/"
Invalid Context= "Mimetypes" line for icon theme:  "/usr/share/icons/Yaru/256x256@2x/mimetypes/"
Invalid Context= "Mimetypes" line for icon theme:  "/usr/share/icons/Yaru/scalable/mimetypes/"
Invalid Context= "Legacy" line for icon theme:  "/usr/share/icons/Adwaita/8x8/legacy/"
Invalid Context= "Legacy" line for icon theme:  "/usr/share/icons/Adwaita/16x16/legacy/"
Invalid Context= "UI" line for icon theme:  "/usr/share/icons/Adwaita/16x16/ui/"
Invalid Context= "Legacy" line for icon theme:  "/usr/share/icons/Adwaita/22x22/legacy/"
Invalid Context= "Legacy" line for icon theme:  "/usr/share/icons/Adwaita/24x24/legacy/"
Invalid Context= "UI" line for icon theme:  "/usr/share/icons/Adwaita/24x24/ui/"
Invalid Context= "Legacy" line for icon theme:  "/usr/share/icons/Adwaita/32x32/legacy/"
Invalid Context= "UI" line for icon theme:  "/usr/share/icons/Adwaita/32x32/ui/"
Invalid Context= "Legacy" line for icon theme:  "/usr/share/icons/Adwaita/48x48/legacy/"
Invalid Context= "UI" line for icon theme:  "/usr/share/icons/Adwaita/48x48/ui/"
Invalid Context= "Legacy" line for icon theme:  "/usr/share/icons/Adwaita/64x64/legacy/"
Invalid Context= "UI" line for icon theme:  "/usr/share/icons/Adwaita/64x64/ui/"
Invalid Context= "Legacy" line for icon theme:  "/usr/share/icons/Adwaita/96x96/legacy/"
Invalid Context= "UI" line for icon theme:  "/usr/share/icons/Adwaita/96x96/ui/"
Invalid Context= "Legacy" line for icon theme:  "/usr/share/icons/Adwaita/256x256/legacy/"
Invalid Context= "Legacy" line for icon theme:  "/usr/share/icons/Adwaita/512x512/legacy/"
Invalid Context= "Legacy" line for icon theme:  "/usr/share/icons/Adwaita/scalable/legacy/"
Invalid Context= "UI" line for icon theme:  "/usr/share/icons/Adwaita/scalable/ui/"

3 Answers 3

1

It seems (as mentioned here and here) some icon themes (in your case, Yaru and Adwaita) don't have all contexts specified.
The easiest solution I found to get rid of these warnings messages with Okular was to use another icon theme, for example, use oxygen-icon-theme in Ubuntu.
Install oxygen-icon-theme from the terminal with:

sudo apt update
sudo apt-get install oxygen-icon-theme

Then, go to Tweaks and change the Icons option to Oxygen in the Appearance menu.

1
  • I'm marking this as solved as this does remove the original problem and mostly explains the cause, but note that this is more of a workaround than an actual solution - it forces me to change the icon theme just to get rid of the useless warnings (and I for one quite liked Yaru) - so if anyone knows how to at least suppress the warnings, please feel free to add an answer or suggest an edit.
    – Atai Ambus
    Dec 11, 2020 at 7:50
1

For a simple workaround, one can redirect output error messages. To make it permanent, define an alias for the okular command. For instance, using bash:

alias okular='okular 2> /dev/null'
0

Manual way to remove this annoying list:

open /usr/share/icons/Adwaita/index.theme with convenient text editor and find/replace both "Legacy" and "UI" with "Action".

Beware those are case sensitive. There was a similar error in mono-dark due to case typo (Stock vs stock) Invalid Context= "stock" line for icon theme: "/usr/share/icons/ubuntu-mono-dark/stock/22/"

Legacy and UI are not valid contexts but the Specifications only mention 4 while there are several more in use. (Can anyone provide a list?)

I have not noticed any detrimental effects from this.

2
  • I actually tried this once, but it reset after a bit, I assume when the theme got some minor update, so sadly this doesn't seem to be a permanent solution either (tho who knows, it might have just been me). It seems the only real way is to actually patch them (note that both Yaru and Adwaita are open source, so you can make a pull request if you want).
    – Atai Ambus
    Mar 8, 2022 at 12:43
  • Good to know, I just might ;) This bothered me a lot when using certain python plot functions in vs code, filling the terminal with useless spam over and over.
    – cryptek
    Mar 9, 2022 at 1:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .