fix: only accept text content (revert 2d7d64c)

This commit is contained in:
yory8 2019-07-17 09:55:09 +02:00
parent 7f5078bfdb
commit 1930514efb

View file

@ -44,7 +44,7 @@ func filter(history []string, text string) []string {
func listen(history []string, histfile string, persist bool, max int) { func listen(history []string, histfile string, persist bool, max int) {
for { for {
t, err := exec.Command("wl-paste", "-n").CombinedOutput() t, err := exec.Command("wl-paste", "-n", "-t", "text").CombinedOutput()
if err != nil { if err != nil {
// wl-paste exits 1 if there's no selection (e.g., when running it at OS startup) // wl-paste exits 1 if there's no selection (e.g., when running it at OS startup)
if string(t) != "No selection\n" { if string(t) != "No selection\n" {