diff options
| -rwxr-xr-x | dpw-menu | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -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] <key>"; 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" |
