From 75122a023a2816144eb0f1a6ede46af6e473fb9a Mon Sep 17 00:00:00 2001 From: Peter Hofmann Date: Sun, 16 Jun 2024 06:15:28 +0200 Subject: [PATCH] Clipboard: Don't use "text/plain" On X11, not all programs offer this target, e.g. some terminals like XTerm. The target "UTF8_STRING" has worked fine for many years and it is what dmenu uses. On Wayland, wl-paste supports the special type "text", which attempts to autodetect a suitable type (in case there is no exact match for "text/plain"). --- lib/menu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/menu.c b/lib/menu.c index 5b2f87f..086481b 100644 --- a/lib/menu.c +++ b/lib/menu.c @@ -1155,11 +1155,11 @@ bm_menu_run_with_key(struct bm_menu *menu, enum bm_key key, uint32_t unicode) { char *paster[2] = {NULL, NULL}; if (key == BM_KEY_PASTE_PRIMARY) { - paster[0] = "wl-paste -t text/plain -p"; - paster[1] = "xclip -t text/plain -out"; + paster[0] = "wl-paste -t text -p"; + paster[1] = "xclip -t UTF8_STRING -out"; } else { - paster[0] = "wl-paste -t text/plain"; - paster[1] = "xclip -t text/plain -out -selection clipboard"; + paster[0] = "wl-paste -t text"; + paster[1] = "xclip -t UTF8_STRING -out -selection clipboard"; } for (size_t paster_i = 0; paster_i < sizeof paster / sizeof paster[0]; paster_i++) {