Earlier quoted context omitted.
I have this in a cron: * 08-23 * * * ~/.local/bin/with-i3 '~/.local/bin/record-active-window' this is record-active-window: # set LOGFILE to whatever place you want to record things. echo "DATE = $(date +%s 2>&1)" >> $LOGFILE echo "IDLE = $(xprintidle)" >> $LOGFILE xprop -id $(xprop -root _NET_ACTIVE_WINDOW | sed 's/.*# //') WM_CLASS WM_NAME 2>&1 >> $LOGFILE this is with-i3 #!/bin/bash source I was too lazy to figure…
I did something similar and found it to be useless for how I work. I even wrote a second tool in Rust that uses the WINAPI (throwback to 1998 when I last used it). Sure, numbers might be 50% correct, but maybe they're not. Say I'm supposed to write some code, so the IDE should be the front window. But I get carried away trying to test an edge case, so I spend 4h in a shell doing stuff that's 100% related, but not in…
Not perfect but decent.