Use bottom right of window for click

vlm_plotz_backup
Tyler Goodlet 2021-09-23 13:26:47 -04:00
parent 7d2a970e32
commit b180fa2083
1 changed files with 16 additions and 6 deletions

View File

@ -29,8 +29,8 @@ t = i3.get_tree()
win_name = 'Interactive Brokers' # what for gw tho? win_name = 'Interactive Brokers' # what for gw tho?
con = t.find_named(win_name)[0] con = t.find_named(win_name)[0]
win_id = con.window win_id = str(con.window)
win_width = con.rect.width w, h = str(con.rect.width), str(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
@ -38,8 +38,18 @@ win_width = con.rect.width
# https://github.com/rr-/pyxdotool # https://github.com/rr-/pyxdotool
# https://github.com/ShaneHutter/pyxdotool # https://github.com/ShaneHutter/pyxdotool
# https://github.com/cphyc/pyxdotool # https://github.com/cphyc/pyxdotool
subprocess.call([
'xdotool',
'windowactivate',
'--sync',
win_id,
# move mouse to bottom left of window (where there should
# be nothing to click).
'mousemove_relative', '--sync', w, h,
subprocess.call( # NOTE: we may need to stick a `--retry 3` in here..
f'xdotool windowactivate --sync {win_id} mousemove_relative ' 'click', '1',
f'--sync {win_width} 1 click 1 key ctrl+alt+f'.split(' ')
) # hackzorzes
'key', 'ctrl+alt+f',
])