diff options
| author | Mitchell Riedstra <mitch@riedstra.dev> | 2024-01-27 10:52:20 -0500 |
|---|---|---|
| committer | Mitchell Riedstra <mitch@riedstra.dev> | 2024-01-27 10:52:20 -0500 |
| commit | cc9c098a7b42abbcc1fad9f59d1cc436deba5c9e (patch) | |
| tree | f1742c16a90ebe1bb440d9f39eff14c46186c4ba | |
| parent | c47a6b1ea6a34c9ee8b387ad6ea9466461223524 (diff) | |
| download | dpw-cc9c098a7b42abbcc1fad9f59d1cc436deba5c9e.tar.gz dpw-cc9c098a7b42abbcc1fad9f59d1cc436deba5c9e.tar.xz | |
Configure the menu to automatically pick up on bemenu in wayland
| -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" |
