summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbzp99 <bertalanp99+git@bertalanp99.eu>2020-06-16 14:05:32 +0200
committerbzp99 <bertalanp99+git@bertalanp99.eu>2020-06-16 14:05:32 +0200
commit28b35af8f6332679344f97fa2b878da40f304d1f (patch)
treedd211801c38389a70fcc94adb46ef5d064071cfc
parent3e98c7a31e889cd9bf5bd53b98470f460b717659 (diff)
downloadscripts-28b35af8f6332679344f97fa2b878da40f304d1f.tar.gz
scripts-28b35af8f6332679344f97fa2b878da40f304d1f.zip
delete passmenuHEADmaster
-rwxr-xr-xpassmenu/passmenu141
-rw-r--r--passmenu/passmenu.189
2 files changed, 0 insertions, 230 deletions
diff --git a/passmenu/passmenu b/passmenu/passmenu
deleted file mode 100755
index eee435d..0000000
--- a/passmenu/passmenu
+++ /dev/null
@@ -1,141 +0,0 @@
-#!/bin/sh
-
-# !!!! UPDATE WITH ROFI GOODNESS
-
-###
-# passmenu - dmenu interface for password-store
-#
-# The popular, commonly used script for this purpose is available at
-# <https://git.zx2c4.com/password-store/tree/contrib/dmenu/passmenu>
-# (as of 2019-05-20).
-# However, that script has been written in bash. This is my own, pure sh
-# implementation. I believe it is slower and a lot less efficient. Nevertheless,
-# it just works(TM). It is also tailored to my own liking.
-#
-# The script requires the following binaries in PATH to work:
-# - pass (password-store, obviously)
-# - dmenu (also rather obvious)
-# - xsel (for the ability to copy the username only)
-#
-# The script has a manual included, but for the sake of redundancy, the options
-# are also listed below. It accepts all options dmenu accepts and uses them as
-# expected.
-#
-# SYNOPSIS: passmenu [-hu] [dmenu options]
-# -h, --help print usage
-# -u, --username copy the username, not the password
-#
-# bertalanp99@ 2019-05-20
-###
-
-#################
-### FUNCTIONS ###
-#################
-
-usage()
-{
- printf 'usage: passmenu [-hu]'
-}
-
-
-#################
-### VARIABLES ###
-#################
-
-prefix=${PASSWORD_STORE_DIR-$HOME/.password-store/}
-
-
-##############
-### SCRIPT ###
-##############
-
-### CHECK FOR BINARIES IN PATH ###
-
-for binary in pass dmenu xsel
-do
- if ! command -v $binary >/dev/null 2>&1
- then
- echo "this script needs '$binary' in PATH to work"
- exit 1
- fi
-done
-
-### PARSE OPTIONS ###
-
-needuser=0
-dmenuoptions=
-while [ -n "$1" ]
-do
- case $1 in
- -b|-f|-i|-v)
- dmenuoptions="$dmenuoptions $1"
- ;;
-
- -l|-m|-p|-fn|-nb|-nf|-sb|-sf|-w)
- dmenuoptions="$dmenuoptions $1 $2"
- shift
- ;;
-
- -c)
- cli=1
- ;;
-
- -h)
- usage
- exit 0
- ;;
-
- -u)
- needuser=1
- ;;
-
- *)
- echo "unknown option -- $1"
- usage
- exit 1
- ;;
- esac
- shift
-done
-
-### MAIN ###
-
-
-if [ -n "$cli" ]
-then
- password="$(\
- find "$prefix" -name '*.gpg' \
- | sed "s|${prefix}\(.*\).gpg|\1|" \
- | fzf)"
- if [ $needuser -eq 0 ]
- then
- pass show "$password" 2>/dev/null \
- | sed 1q \
- | tr -d '\n' \
- | xsel --input
- else
- pass show "$password" 2>/dev/null \
- | awk '/login:/{print $2}' \
- | tr -d '\n' \
- | xsel --input
- fi
- return
-fi
-
-password="$(\
- find "$prefix" -name '*.gpg' \
- | sed "s|${prefix}\(.*\).gpg|\1|" \
- | rofi -dmenu $dmenuoptions)"
-
-if [ $needuser -eq 0 ]
-then
- pass show "$password" 2>/dev/null \
- | sed 1q \
- | tr -d '\n' \
- | xsel --input
-else
- pass show "$password" 2>/dev/null \
- | awk '/login:/{print $2}' \
- | tr -d '\n' \
- | xsel --input
-fi
diff --git a/passmenu/passmenu.1 b/passmenu/passmenu.1
deleted file mode 100644
index 399ae3a..0000000
--- a/passmenu/passmenu.1
+++ /dev/null
@@ -1,89 +0,0 @@
-.\"""
-.\" passmenu.1 - passmenu man page
-.\"
-.\" bertalanp99@ 2019-05-20
-.\"""
-.Dd 2019-05-20
-.Dt PASSMENU 1
-.Os
-.Sh NAME
-.Nm passmenu
-.Nd dmenu interface for password-store (pass)
-.Sh SYNOPSIS
-.Nm passmenu
-.Op Fl hu
-.Op dmenu options
-.Sh DESCRIPTION
-The
-.Nm
-utility provides a quick and easy interface for
-.Xr pass 1
-using
-.Xr dmenu 1
-.Ns . It reads all passwords from
-.Ev PASSWORD_STORE DIR
-(
-.Ns Pa ~/.password-store
-if unset) and displays them in dmenu. The selected password is
-copied to the clipboard.
-
-The following options are available:
-.Bl -tag -width Ds -compact
-.It Fl h
-Print usage
-.It Fl u
-Copy the username, not the password
-.It dmenu options
-.Nm
-accepts all options
-.Xr dmenu 1
-accepts and passes them to it.
-.El
-.Sh ENVIRONMENT
-.Pp
-The following environment variables affect
-.Nm
-:
-.Bl -tag -width Ds -compact
-.It Ev PASSWORD_STORE_DIR
-The location of the password-store
-.El
-.Sh EXIT STATUS
-.Nm
-returns 0 on success
-and
-1 on any error
-.Sh EXAMPLES
-Run
-.Nm
-with various options passed to dmenu:
-.Bd -literal -offset indent -compact
-passmenu -nb '#000' -nf '#FFF' -sb '#AAA' -sf '#000'
-.Be
-.Sh SEE ALSO
-.Xr pass 1
-.Xr dmenu 1
-.Sh HISTORY
-There is a popular script with the same name, however, that is a different
-implementation. As of 2019-05-20, said script is available at
-.Lk https://git.zx2c4.com/password-store/tree/contrib/dmenu/passmenu
-.Sh AUTHORS
-The
-.Nm
-script was written by
-.An Bertalan Z. P├ęter Aq Mt bertalanp99@bertalanp99.eu
-.Sh CAVEATS
-.Pp
-Beware that when copying passwords using the
-.Fl u
-option,
-.Nm
-actually just takes the second line of the password file and trims the string
-.Ql login:\
-out. Therefore passwords are expected to be stored in the form
-.Bd -literal -offset indent -compact
-my-highly-secure-password999
-login: my-username
-url: https://some-site.domain
-\&...
-.Ed