If you've ever tried to manually look for the current icon theme, you've probably come to the (correct) conclusion that it's simply impossible to do it in a portable way: each desktop environment in existence stores that information in a different place, and it's none give out that info in a common way.
In order to find out the current icon theme then, we first need to find out the current desktop environment and only then we can get the current icon theme in a desktop-dependent way. To do that, we can use the following environemnt variables:
XDG_SESSION_DESKTOP
: contains the name of the current session name.XDG_CURRENT_DESKTOP
: contains a:
-separated list of current desktop names.