From cc9c098a7b42abbcc1fad9f59d1cc436deba5c9e Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Sat, 27 Jan 2024 10:52:20 -0500 Subject: Configure the menu to automatically pick up on bemenu in wayland --- dpw-menu | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/dpw-menu b/dpw-menu index 94182e7..db5b120 100755 --- a/dpw-menu +++ b/dpw-menu @@ -1,7 +1,7 @@ #!/bin/sh # Dmenu script for dpw # -# Copyright 2021 Mitchell Riedstra +# Copyright 2024 Mitchell Riedstra # # Permission to use, copy, modify, and/or distribute this software for any purpose # with or without fee is hereby granted, provided that the above copyright notice @@ -22,7 +22,20 @@ while [ $# -gt 0 ] ; do case "$1" in -h) echo "$0 [-t|--type] [-o|-otp] "; exit 0 ;; *) break ;; esac ; done -pass="$(dpw list | dmenu "$@")" + +# Pretty much anything that implements a demu like interface should work here, +# the only option called elsewhere is `-p` +_menu="dmenu" +if [ "$XDG_SESSION_TYPE" = "wayland" ] ; then + _menu="bemenu" +fi + +case $(uname) in + Darwin) _menu="choose -m -s 16 -f Monaco -w 85" ;; + *) ;; +esac + +pass="$(dpw list | $_menu "$@")" if [ $_type -eq 1 ] ; then dpw $otp type "$pass" -- cgit v1.2.3