Add ib gateway support, loop through names
parent
a114329ad9
commit
980a6dde05
|
@ -26,19 +26,26 @@ i3 = i3ipc.Connection()
|
||||||
t = i3.get_tree()
|
t = i3.get_tree()
|
||||||
|
|
||||||
# for tws
|
# for tws
|
||||||
win_name = 'Interactive Brokers' # what for gw tho?
|
win_names: list[str] = [
|
||||||
con = t.find_named(win_name)[0]
|
'Interactive Brokers', # tws running in i3
|
||||||
|
'IB Gateway.', # gw running in i3
|
||||||
|
]
|
||||||
|
|
||||||
win_id = str(con.window)
|
for name in win_names:
|
||||||
w, h = con.rect.width, con.rect.height
|
results = t.find_named(name)
|
||||||
|
if results:
|
||||||
|
con = results[0]
|
||||||
|
print(f'Resetting data feed for {name}')
|
||||||
|
win_id = str(con.window)
|
||||||
|
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
|
||||||
# most recent commit history:
|
# most recent commit history:
|
||||||
# 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([
|
subprocess.call([
|
||||||
'xdotool',
|
'xdotool',
|
||||||
'windowactivate', '--sync', win_id,
|
'windowactivate', '--sync', win_id,
|
||||||
|
|
||||||
|
@ -51,4 +58,4 @@ subprocess.call([
|
||||||
|
|
||||||
# hackzorzes
|
# hackzorzes
|
||||||
'key', 'ctrl+alt+f',
|
'key', 'ctrl+alt+f',
|
||||||
])
|
])
|
||||||
|
|
Loading…
Reference in New Issue