Pass window id to click subcmd

vlm_plotz_backup
Tyler Goodlet 2021-09-24 11:13:30 -04:00
parent b180fa2083
commit a114329ad9
1 changed files with 5 additions and 6 deletions

View File

@ -30,7 +30,7 @@ win_name = 'Interactive Brokers' # what for gw tho?
con = t.find_named(win_name)[0] con = t.find_named(win_name)[0]
win_id = str(con.window) win_id = str(con.window)
w, h = str(con.rect.width), str(con.rect.height) w, h = con.rect.width, con.rect.height
# TODO: seems to be a few libs for python but not sure # TODO: seems to be a few libs for python but not sure
# if they support all the sub commands we need, order of # if they support all the sub commands we need, order of
@ -40,15 +40,14 @@ w, h = str(con.rect.width), str(con.rect.height)
# https://github.com/cphyc/pyxdotool # https://github.com/cphyc/pyxdotool
subprocess.call([ subprocess.call([
'xdotool', 'xdotool',
'windowactivate', 'windowactivate', '--sync', win_id,
'--sync',
win_id,
# move mouse to bottom left of window (where there should # move mouse to bottom left of window (where there should
# be nothing to click). # be nothing to click).
'mousemove_relative', '--sync', w, h, 'mousemove_relative', '--sync', str(w-3), str(h-3),
# NOTE: we may need to stick a `--retry 3` in here.. # NOTE: we may need to stick a `--retry 3` in here..
'click', '1', 'click', '--window', win_id, '1',
# hackzorzes # hackzorzes
'key', 'ctrl+alt+f', 'key', 'ctrl+alt+f',