diff --git a/demon.go b/demon.go index 5852365..ddf2f09 100644 --- a/demon.go +++ b/demon.go @@ -50,7 +50,7 @@ func listen(history []string, histfile string, persist bool, max int) error { t, err := exec.Command("wl-paste", []string{"-n", "-t", "text"}...).CombinedOutput() if err != nil { // wl-paste exits 1 if there's no selection (e.g., when running it at OS startup) - if string(t) != "No selection" { + if string(t) != "No selection\n" { log.Printf("Error running wl-paste (demon.52): %s", t) } time.Sleep(1 * time.Second) diff --git a/selector.go b/selector.go index 9c1fc4c..70e68bc 100644 --- a/selector.go +++ b/selector.go @@ -20,11 +20,9 @@ func selector(history []string, max int) error { } // serve selection to the OS - if err := exec.Command("wl-copy", []string{"--", selected}...).Run(); err != nil { - return err - } + err = exec.Command("wl-copy", []string{"--", selected}...).Run() - return nil + return err } func dmenu(list []string, max int) (string, error) {