#!/usr/bin/wish # winlock - lock current window from keypresses, hacky way set wid [exec xdotool getwindowfocus] set title [exec xdotool getwindowname $wid] # Use "focus" instead of "mouse-enter" when using a EWMH-capable wm. set pid [exec xdotool behave $wid mouse-enter windowfocus 0 &] # racy, but what else... proc cleanup {} { global pid exec kill $pid exit } bind . cleanup button .exit -text "Unlock '$title'" -command cleanup pack .exit