[PATCH] Allow alternatives to dmenu for passmenu

Stefan Gehr stefan.kerman.gehr at fau.de
Sun Jan 31 08:05:54 UTC 2021


> I think this is also the best solution for allowing wayland support in
> passmenu.
Wayland support is exactly what I had in mind. But I'm not so sure
anymore if an environment variable is that elegant. Maybe an optional
argument `--menu` that can be used as `--menu bemenu` or maybe
`--menu=bemenu` would be better? Or maybe allow both, but let the
argument have preference over the environment variable.

On 2021-01-28T21:03:02, sternenseemann wrote:
> I think this is also the best solution for allowing wayland support in
> passmenu. A similar environment variable for xdotool could also be
> worthwhile so users can switch to ydotool.
> 
> On 1/28/21 8:08 PM, Stefan Gehr wrote:
> > Set the environment variable $PASSMENU_PROGRAM to your preferred menu
> > program. If it isn't set then dmenu will be used. This allows users to
> > use alternatives like bemenu.
> > ---
> >  contrib/{dmenu => passmenu}/README.md | 4 +++-
> >  contrib/{dmenu => passmenu}/passmenu  | 4 +++-
> >  2 files changed, 6 insertions(+), 2 deletions(-)
> >  rename contrib/{dmenu => passmenu}/README.md (72%)
> >  rename contrib/{dmenu => passmenu}/passmenu (79%)
> > 
> > diff --git a/contrib/dmenu/README.md b/contrib/passmenu/README.md
> > similarity index 72%
> > rename from contrib/dmenu/README.md
> > rename to contrib/passmenu/README.md
> > index 9d54fb4..cee87eb 100644
> > --- a/contrib/dmenu/README.md
> > +++ b/contrib/passmenu/README.md
> > @@ -2,12 +2,14 @@
> >  password manager. This design allows you to quickly copy a password to the
> >  clipboard without having to open up a terminal window if you don't already have
> >  one open. If `--type` is specified, the password is typed using [xdotool][]
> > -instead of copied to the clipboard.
> > +instead of copied to the clipboard. You can use alternatives to dmenu, like
> > +[bemenu][], by setting `$PASSMENU_PROGRAM` to the program of your preference.
> >  
> >  # Usage
> >  
> >      passmenu [--type] [dmenu arguments...]
> >  
> >  [dmenu]: http://tools.suckless.org/dmenu/
> > +[bemenu]: https://github.com/Cloudef/bemenu
> >  [xdotool]: http://www.semicomplete.com/projects/xdotool/
> >  [pass]: http://www.zx2c4.com/projects/password-store/
> > diff --git a/contrib/dmenu/passmenu b/contrib/passmenu/passmenu
> > similarity index 79%
> > rename from contrib/dmenu/passmenu
> > rename to contrib/passmenu/passmenu
> > index 83268bc..f63b9e6 100755
> > --- a/contrib/dmenu/passmenu
> > +++ b/contrib/passmenu/passmenu
> > @@ -13,7 +13,9 @@ password_files=( "$prefix"/**/*.gpg )
> >  password_files=( "${password_files[@]#"$prefix"/}" )
> >  password_files=( "${password_files[@]%.gpg}" )
> >  
> > -password=$(printf '%s\n' "${password_files[@]}" | dmenu "$@")
> > +[[ "$PASSMENU_PROGRAM" ]] || PASSMENU_PROGRAM="dmenu"
> > +
> > +password=$(printf '%s\n' "${password_files[@]}" | "$PASSMENU_PROGRAM" "$@")
> >  
> >  [[ -n $password ]] || exit
> >  
> > 


More information about the Password-Store mailing list