Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random error when running in the background #15

Closed
marioortizmanero opened this issue Jul 5, 2019 · 5 comments
Closed

Random error when running in the background #15

marioortizmanero opened this issue Jul 5, 2019 · 5 comments

Comments

@marioortizmanero
Copy link

Sometimes when I'm running this script it closes itself with this error:

    Traceback (most recent call last):
      File ".config/i3/scripts/alternating_layouts.py", line 109, in <module>
        main()
      File ".config/i3/scripts/alternating_layouts.py", line 102, in main
        set_layout()
      File ".config/i3/scripts/alternating_layouts.py", line 41, in set_layout
        current_win = i3.filter(nodes=[], focused=True)
      File "/usr/lib/python3.7/site-packages/i3.py", line 508, in filter
        tree = msg('get_tree')
      File "/usr/lib/python3.7/site-packages/i3.py", line 392, in msg
        response = default_socket().get(type, message)
      File "/usr/lib/python3.7/site-packages/i3.py", line 181, in get
        self.send(msg_type, payload)
      File "/usr/lib/python3.7/site-packages/i3.py", line 203, in send
        self.socket.sendall(message)
    BrokenPipeError: [Errno 32] Broken pipe

I'm running arch and followed the install guide

@olemartinorg
Copy link
Owner

This shouldn't happen randomly. Does it happen when you restart i3wm?
See #14, it was reported there as well, but only when restarting i3wm. Does it work better if you start it with exec_always instead?

@marioortizmanero
Copy link
Author

I'll try using exec_always and I'll report back. I've added a very ugly looking try and catch that just restarts the script anyway. Also, i3-py is deprecated, could it be something related to that, too?

@iFreilicht
Copy link
Contributor

This seems to be an issue with i3-py. As I wrote in #16, there is a replacement called i3ipc-python. Rewriting this tool slightly to use the new module would likely solve this issue.

@neilbags
Copy link

neilbags commented May 2, 2020

I'm also using a try/except in a loop to workaround this error. See PR #22

@olemartinorg
Copy link
Owner

i3-py has now been replaced with i3ipc, by merging #26. Closing this, but do not hesitate to reach out if this causes any new problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants