swaysw: don't return error when no window is selected in wofi
This commit is contained in:
parent
de732b8317
commit
1e49032fbf
9
main.go
9
main.go
@ -44,7 +44,7 @@ func selectWithWofi(windows string) string {
|
||||
cmd.Stdin = strings.NewReader(windows)
|
||||
stdout, err := cmd.Output()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
return ""
|
||||
}
|
||||
return strings.TrimSpace(string(stdout))
|
||||
}
|
||||
@ -82,7 +82,8 @@ func main() {
|
||||
var windows []window
|
||||
flatten(swaymsg_output, &windows)
|
||||
|
||||
selected := selectWithWofi(getWindowNames(windows))
|
||||
windowId := findWindowId(selected, windows)
|
||||
switchToWindow(windowId)
|
||||
if selected := selectWithWofi(getWindowNames(windows)); selected != "" {
|
||||
windowId := findWindowId(selected, windows)
|
||||
switchToWindow(windowId)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user