We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8d9ec80 commit 68946e1Copy full SHA for 68946e1
examples/tiling-indicator.py
@@ -0,0 +1,27 @@
1
+#!/usr/bin/env python3
2
+import i3ipc
3
+
4
+i3 = i3ipc.Connection()
5
+splitv_text = 'V'
6
+splith_text = 'H'
7
+last = ''
8
9
10
+def on_event(self, _):
11
+ global last
12
+ layout = i3.get_tree().find_focused().parent.layout
13
+ if layout == 'splitv' and not layout == last:
14
+ print(splitv_text)
15
+ elif layout == 'splith' and not layout == last:
16
+ print(splith_text)
17
+ elif layout != last:
18
+ print(' ')
19
+ last = layout
20
21
22
+# Subscribe to events
23
+i3.on("window::focus", on_event)
24
+i3.on("binding", on_event)
25
26
+# Start the main loop and wait for events to come in.
27
+i3.main()
0 commit comments