code: def focus_window(winhandle, path=None, name=None, sleeptime=.01):
          
          import utool as ut
          import time
          print('focus: ' + winhandle)
          args = ['wmctrl', '-xa', winhandle]
          ut.cmd(*args, verbose=False, quiet=True)
          time.sleep(sleeptime)
docs: sudo apt-get install xautomation
          apt-get install autokey-gtk
  
          wmctrl -xa gnome-terminal.Gnome-terminal
          wmctrl -xl