#!/bin/bash

ID=$(niri msg -j windows | jq -r '.[] | select(.app_id == "pomo") | .id' | head -1)

if [ -n "$ID" ] && [ "$ID" != "null" ]; then
    niri msg action focus-window --id "$ID"
else
    footclient --app-id=pomo pomo
fi
