From a114329ad996bd3f57ca9245d79cd76503e662b6 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Fri, 24 Sep 2021 11:13:30 -0400 Subject: [PATCH] Pass window id to click subcmd --- snippets/ib_data_reset.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/snippets/ib_data_reset.py b/snippets/ib_data_reset.py index a6f7df0c..2c252218 100644 --- a/snippets/ib_data_reset.py +++ b/snippets/ib_data_reset.py @@ -30,7 +30,7 @@ win_name = 'Interactive Brokers' # what for gw tho? con = t.find_named(win_name)[0] 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 # 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 subprocess.call([ 'xdotool', - 'windowactivate', - '--sync', - win_id, + 'windowactivate', '--sync', win_id, + # move mouse to bottom left of window (where there should # 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.. - 'click', '1', + 'click', '--window', win_id, '1', # hackzorzes 'key', 'ctrl+alt+f',