From 0a00dede30165dd61e94fe8c0c4b71f01dce7288 Mon Sep 17 00:00:00 2001 From: yory8 <> Date: Thu, 9 May 2019 08:42:43 +0200 Subject: [PATCH] docs + style --- README.md | 4 ++-- selector.go | 25 ++++++++++++------------- 2 files changed, 14 insertions(+), 15 deletions(-) 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