altdesktop / i3ipc-python

🐍 An improved Python library to control i3wm and sway.
http://i3ipc-python.readthedocs.io
BSD 3-Clause "New" or "Revised" License
858 stars 108 forks source link

'WindowEvent' has no attribute 'replace' #181

Open hernan3009 opened 3 years ago

hernan3009 commented 3 years ago

Hi,

I am trying to automatically perform font size changes in the terminal when its window is anyhow resized. I get AtributeError with this short code

from i3ipc import Connection, Event
import i3ipc

i3 = Connection()
def is_resizing(i3, e):
    print("lets see")
    return

i3.on(i3ipc.WindowEvent, is_resizing)

i3.main()

It returns File "/home/XXXXX/Aplicaciones/miniconda3/lib/python3.9/site-packages/i3ipc/connection.py", line 375, in on event = event.replace('-', '_') AttributeError: type object 'WindowEvent' has no attribute 'replace'

I tried to comment the line no. 375 but similar errors still remains.

Is this a bug or I am doing something wrong?

Thanks!

Note: The same happens for WorkspaceEvent sway version 1.5.1 Fedora 34