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

focus-last.py: Terminate threads and re-instantiate after a broken pipe #179

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

elig0n
Copy link

@elig0n elig0n commented Mar 31, 2021

When restarting i3 the socket connection with the script is lost (broken pipe), requiring manual restart of the script and also optionally killing the previous rogue instance(s).

This PR invents a stopping mechanism for the threads which then re-instantiate FocusWatcher after a broken pipe exception is detected, thereby providing uninterrupted operation of the script between restarts. (It takes a few seconds until it re-establishes)

The last remembered window is lost but registry continues on the new session as the user keeps changing focus.
Maybe someone else can assist to implement persistent history?

Fixes and improvements are welcome

elig0n added 2 commits March 31, 2021 12:36
when restarting i3 the socket connection is lost (broken pipe), requiring manual restart of the script and optionally killing the amassing previous one(s)
this invents a stop mechanism for the threads and also re-instantiate FocusWatcher when a broken pipe exception is detected
history is lost but registry continues on current session
@acrisci
Copy link
Member

acrisci commented Jul 17, 2021

I would like to merge this, but it would be breaking for people who use exec_always which is probably everyone who uses it right now.

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

Successfully merging this pull request may close these issues.

2 participants