fixing some niri issues

This commit is contained in:
Chris Cochrun 2026-01-28 10:30:23 -06:00
parent bf71afb8b5
commit 5d4ce7bfe3
2 changed files with 22 additions and 12 deletions

View file

@ -1,15 +1,10 @@
#/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 {
let open = niri msg --json windows | from json | where app_id == $app | get id | first;
if open == null {
bash -c $"($command) &"
} else {
niri msg action focus-window --id $open
}
}