#!/usr/bin/env python3

import i3ipc
import sys
import subprocess

i3 = i3ipc.Connection()

def on_window_focus(i3, e):
    focused = i3.get_tree().find_focused()
    subprocess.call("~/.config/i3blocks/i3blocks-contrib/Window/Window", shell=True)
    sys.stdout.flush()

on_window_focus(i3, None)

i3.on('window::focus', on_window_focus)

i3.main()
