Apr-24-2021, 05:50 AM
Much thanks to all. I found the solution some days ago and I am attaching the code.
## autokey alt + shift + 1
import gi
gi.require_version("Wnck", "3.0")
from gi.repository import Wnck
scr = Wnck.Screen.get_default()
scr.force_update()
keyboard.send_keys(scr.get_active_window().get_name())
