#/usr/bin/env nu def main [app: string, command: string] { let open = try { niri msg --json windows | from json | where app_id == $app | get id | first } catch { 0 } if $open > 0 { niri msg action focus-window --id $open } else { bash -c $"($command) &" } }