#!/bin/bash
# Skip lock if a fullscreen window is active (game, video, etc.)
active=$(xprop -root _NET_ACTIVE_WINDOW 2>/dev/null | awk '{print $NF}')
if [ -n "$active" ] && [ "$active" != "0x0" ]; then
    state=$(xprop -id "$active" _NET_WM_STATE 2>/dev/null)
    if echo "$state" | grep -q "_NET_WM_STATE_FULLSCREEN"; then
        exit 0
    fi
fi
exec ~/.config/i3/scripts/lock-now
