diff --git a/main.go b/main.go index 977952b..c8c4898 100644 --- a/main.go +++ b/main.go @@ -65,7 +65,7 @@ func main() { log.Fatal(err) } - selection, err := selector(history, *maxPicker, *pickTool) + selection, err := selector(history, *maxPicker, *pickTool, "pick") if err != nil { log.Fatal(err) } @@ -90,7 +90,7 @@ func main() { return } - selection, err := selector(history, *maxClearer, *clearTool) + selection, err := selector(history, *maxClearer, *clearTool, "clear") if err != nil { log.Fatal(err) } diff --git a/selector.go b/selector.go index 46f67cb..76c5012 100644 --- a/selector.go +++ b/selector.go @@ -9,7 +9,7 @@ import ( "strings" ) -func selector(data []string, max int, tool string) (string, error) { +func selector(data []string, max int, tool string, prompt string) (string, error) { if len(data) == 0 { return "", errors.New("nothing to show: no data available") } @@ -35,11 +35,11 @@ func selector(data []string, max int, tool string) (string, error) { "-l", strconv.Itoa(max)} case "rofi": - args = []string{"rofi", "-dmenu", + args = []string{"rofi", "-p", prompt, "-dmenu", "-lines", strconv.Itoa(max)} case "wofi": - args = []string{"wofi", "--cache-file", "/dev/null", "--dmenu"} + args = []string{"wofi", "-p", prompt, "--cache-file", "/dev/null", "--dmenu"} default: return "", fmt.Errorf("Unsupported tool: %s", tool) }