Artificial intelligent assistant

Hooking onto entering and leaving window in i3 Is it possible to hook onto the events of entering and leaving a window in i3? I want to use this to make my winkey hyper in Emacs and super outside.

Under X11 you could use `xprop` to listen for all window activation events and then execute some logic that depends on window class name.


#!/bin/bash

xprop -spy -root _NET_ACTIVE_WINDOW | grep --line-buffered -o '0[xX][a-zA-Z0-9]\{7\}' |
while read -r id; do
class="$(xprop -id $id WM_CLASS)"
if [ -n "$class" ]; then
echo "Active window class is: $class"
fi
done

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy fcf5ae68949b5e0e5c5cab430d17e341