[PATCH v2 2/2] Support bemenu under wayland

Daniel Cordero pass at 0xdc.io
Mon Feb 17 14:49:18 CET 2020


In a resized/scaled wayland display, dmenu running under Xwayland can
look blurry.

On wayland, use a wayland-native menu program if it is available.
Otherwise, continue using dmenu.
---
 contrib/dmenu/passmenu | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/contrib/dmenu/passmenu b/contrib/dmenu/passmenu
index 83268bc..ae3ef5c 100755
--- a/contrib/dmenu/passmenu
+++ b/contrib/dmenu/passmenu
@@ -13,7 +13,13 @@ password_files=( "$prefix"/**/*.gpg )
 password_files=( "${password_files[@]#"$prefix"/}" )
 password_files=( "${password_files[@]%.gpg}" )
 
-password=$(printf '%s\n' "${password_files[@]}" | dmenu "$@")
+if [[ -n "$WAYLAND_DISPLAY" ]] && [[ -n "$(command -v bemenu 2>/dev/null)" ]]; then
+	menu=bemenu
+else
+	menu=dmenu
+fi
+
+password=$(printf '%s\n' "${password_files[@]}" | $menu "$@")
 
 [[ -n $password ]] || exit
 
-- 
2.24.1


More information about the Password-Store mailing list