-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathi3.py
More file actions
31 lines (20 loc) · 694 Bytes
/
i3.py
File metadata and controls
31 lines (20 loc) · 694 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import i3ipc
from i3ipc import Event
import functions
def main():
# def on_window_new(i3, e):
# if e.container.name == "Terminal":
# functions.log_to_txt(e.container.name)
# # pyperclip.copy("~/pythonui/pos-greeter.py\n")
# # pyperclip.paste()
def on_window_close(i3, e):
tree = i3.get_tree()
if len(tree.find_classed("Alacritty")) == 0:
functions.log_to_txt("All terminal windows closed")
i3.command("exec alacritty")
i3 = i3ipc.Connection()
i3.on(Event.WINDOW_CLOSE, on_window_close)
# i3.on(Event.WINDOW_NEW, on_window_new)
i3.main()
if __name__ == "__main__":
main()