fixing some niri issues
This commit is contained in:
parent
bf71afb8b5
commit
5d4ce7bfe3
2 changed files with 22 additions and 12 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue