I would like to know if I can get with python know what type of selection is set by the user regardless of whether it is active or not in the panel of active tools.
import bpy
from bl_ui.space_toolsystem_common import ToolSelectPanelHelper
context = bpy.context
workspace = context.workspace
space_type = workspace.tools_space_type
mode = workspace.tools_mode
cls = ToolSelectPanelHelper._tool_class_from_space_type(space_type)
if cls is not None:
for i, item in enumerate(cls.tools_from_context(context)):
if item is not None:
if type(item) is tuple:
if i == 0:
print(item[0].text)