diff --git a/README.md b/README.md index 7b8d75b..b02450a 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ A basic clipboard manager for Wayland, with support for persisting copy buffers ## Requirements -- a windows manager that uses `wlr-data-control`, like Sway and other wlroots-bases WMs. +- a windows manager that uses `wlr-data-control`, like Sway and other wlroots-based WMs. - wl-clipboard from latest master (NOT v1.0) -- dmenu +- dmenu or rofi ## Usage diff --git a/selector.go b/selector.go index 7d77c4c..a01b8ac 100644 --- a/selector.go +++ b/selector.go @@ -30,18 +30,18 @@ func dmenu(list []string, max int, tool string) (string, error) { return "", nil } - var args []string; - if tool == "dmenu" { - args = []string{"dmenu", "-b", - "-fn", - "-misc-dejavu sans mono-medium-r-normal--17-120-100-100-m-0-iso8859-16", - "-l", - strconv.Itoa(max)} - } else { - args = []string{"rofi", "-dmenu", - "-lines", - strconv.Itoa(max)} - } + var args []string + if tool == "dmenu" { + args = []string{"dmenu", "-b", + "-fn", + "-misc-dejavu sans mono-medium-r-normal--17-120-100-100-m-0-iso8859-16", + "-l", + strconv.Itoa(max)} + } else { + args = []string{"rofi", "-dmenu", + "-lines", + strconv.Itoa(max)} + } // dmenu will break if items contain newlines, so we must pass them as literals. // however, when it sends them back, we need a way to restore them to non literals @@ -65,7 +65,6 @@ func dmenu(list []string, max int, tool string) (string, error) { cmd := exec.Cmd{Path: "/usr/bin/" + tool, Args: args, Stdin: input} selected, err := cmd.Output() if err != nil { - fmt.Printf("%s", err) return "", err } trimmed := selected[:len(selected)-1] // drop newline