{pkgs, ...}: pkgs.writeShellApplication { name = "active-window"; runtimeInputs = [pkgs.jq]; text = '' if [[ -n "''${NIRI_SOCKET:-}" ]]; then FOCUSED_ID=$(niri msg --json focused-window | jq '.id') niri msg --json windows \ | jq --argjson id "$FOCUSED_ID" \ '[.[] | select(.id == $id)] | first | {compositor: "niri", class: .app_id, pid: .pid}' elif [[ -n "''${HYPRLAND_INSTANCE_SIGNATURE:-}" ]]; then hyprctl activewindow -j \ | jq '{compositor: "hyprland", class: .class, pid: .pid}' else printf '{"compositor":"unknown","class":null,"pid":null}\n' fi ''; }