dotfiles/scripts/nirilof
2025-09-01 06:24:31 -05:00

15 lines
288 B
Text
Executable file

#/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) &"
}
}