Updated mirrors and command checking
This commit is contained in:
parent
6a932074b5
commit
c28199ad4b
15
README.md
15
README.md
@ -7,7 +7,7 @@ Similar to [password-store](https://git.zx2c4.com/password-store/about/), but wr
|
|||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
- [gpg](https://gnupg.org/)
|
- [gpg](https://gnupg.org/)
|
||||||
- tree
|
- [tree](https://oldmanprogrammer.net/source.php?dir=projects/tree)
|
||||||
|
|
||||||
###### Optional Requirements
|
###### Optional Requirements
|
||||||
- [nano](https://www.nano-editor.org/) *(required only if environment variable `$EDITOR` is not set)*
|
- [nano](https://www.nano-editor.org/) *(required only if environment variable `$EDITOR` is not set)*
|
||||||
@ -20,8 +20,8 @@ Similar to [password-store](https://git.zx2c4.com/password-store/about/), but wr
|
|||||||
## Config
|
## Config
|
||||||
Edit the source code to change these settings:
|
Edit the source code to change these settings:
|
||||||
|
|
||||||
| Setting | Description |
|
| Setting | Description |
|
||||||
| -------- | ------------------------------------------------------------------------------------------------------------------ |
|
| ---------- | ---------------------------------------------------------------------------------------------------------------- |
|
||||||
| `GPG_ID` | Default GPG key ID to use for encrypting/decrypting |
|
| `GPG_ID` | Default GPG key ID to use for encrypting/decrypting |
|
||||||
| `GPG_OPTS` | Do not edit this unless you know what you are doing |
|
| `GPG_OPTS` | Do not edit this unless you know what you are doing |
|
||||||
| `METHOD` | Method used for the menu *("copy" will use xclip to copy passwords & "type" will use xdotool to type passwords)* |
|
| `METHOD` | Method used for the menu *("copy" will use xclip to copy passwords & "type" will use xdotool to type passwords)* |
|
||||||
@ -57,8 +57,7 @@ fi
|
|||||||
```
|
```
|
||||||
Make it executable with `chmod +x $HOME/.gnupg/pinentry-wrapper` and then edit your `$HOME/.gnupg/gpg-agent.conf` to include `pinentry-program $HOME/.gnupg/pinentry-wrapper`.
|
Make it executable with `chmod +x $HOME/.gnupg/pinentry-wrapper` and then edit your `$HOME/.gnupg/gpg-agent.conf` to include `pinentry-program $HOME/.gnupg/pinentry-wrapper`.
|
||||||
|
|
||||||
## Mirrors
|
___
|
||||||
- [acid.vegas](https://git.acid.vegas/pass)
|
|
||||||
- [GitHub](https://github.com/acidvegas/pass)
|
###### Mirrors
|
||||||
- [GitLab](https://gitlab.com/acidvegas/pass)
|
[acid.vegas](https://git.acid.vegas/pass) • [GitHub](https://github.com/acidvegas/pass) • [GitLab](https://gitlab.com/acidvegas/pass) • [SuperNETs](https://git.supernets.org/acidvegas/pass)
|
||||||
- [SuperNETs](https://git.supernets.org/acidvegas/pass)
|
|
||||||
|
18
pass
18
pass
@ -68,7 +68,7 @@ menu() {
|
|||||||
elif [ -f $cwd/$cmd ]; then
|
elif [ -f $cwd/$cmd ]; then
|
||||||
if [ $METHOD = "copy" ]; then
|
if [ $METHOD = "copy" ]; then
|
||||||
export PINENTRY_USER_DATA="dmenu" | gpg -d $GPG_OPTS $cwd/$cmd | dmenu "$@" | xclip -selection clipboard
|
export PINENTRY_USER_DATA="dmenu" | gpg -d $GPG_OPTS $cwd/$cmd | dmenu "$@" | xclip -selection clipboard
|
||||||
sleep 3 && xclip -selection clipboard /dev/null
|
sleep 3 && xclip -selection clipboard /dev/nul
|
||||||
elif [ $METHOD = "type" ]; then
|
elif [ $METHOD = "type" ]; then
|
||||||
export PINENTRY_USER_DATA="dmenu" | gpg -d $GPG_OPTS $cwd/$cmd | dmenu "$@" | xdotool type --delay 3 "$D"
|
export PINENTRY_USER_DATA="dmenu" | gpg -d $GPG_OPTS $cwd/$cmd | dmenu "$@" | xdotool type --delay 3 "$D"
|
||||||
fi
|
fi
|
||||||
@ -103,17 +103,17 @@ show() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Main
|
# Main
|
||||||
[ ! $(command -v gpg) ] && echo "error: missing required packaged 'gpg'" && exit 1
|
command -v gpg >/dev/null || { echo "error: missing required package 'gpg'"; exit 1; }
|
||||||
[ ! $(command -v tree) ] && echo "error: missing required packaged 'tree'" && exit 1
|
command -v tree >/dev/null || { echo "error: missing required package 'tree'"; exit 1; }
|
||||||
if [ "$#" = '1' ]; then
|
if [ "$#" = '1' ]; then
|
||||||
if [ $1 = 'menu' ]; then
|
if [ $1 = 'menu' ]; then
|
||||||
[ ! $(command -v dmenu) ] && echo "error: missing required packaged 'dmenu'" && exit 1
|
command -v dmenu >/dev/null || { echo "error: missing required package 'dmenu'"; exit 1; }
|
||||||
[ ! $(command -v pinentry) ] && echo "error: missing required packaged 'pinentry'" && exit 1
|
command -v pinentry >/dev/null || { echo "error: missing required package 'pinentry'"; exit 1; }
|
||||||
[ ! $(command -v pinentry-dmenu) ] && echo "error: missing required packaged 'pinentry-dmenu'" && exit 1
|
command -v pinentry-dmenu >/dev/null || { echo "error: missing required package 'pinentry-dmenu'"; exit 1; }
|
||||||
if [ $METHOD = "copy" ]; then
|
if [ $METHOD = "copy" ]; then
|
||||||
[ ! $(command -v xclip) ] && echo "error: missing required packaged 'xclip'" && exit 1
|
command -v dmenu >/dev/null || { echo "error: missing required package 'xclip'"; exit 1; }
|
||||||
elif [ $METHOD = 'type' ]; then
|
elif [ $METHOD = 'type' ]; then
|
||||||
[ ! $(command -v xdotool) ] && echo "error: missing required packaged 'xdotool'" && exit 1
|
command -v xdotool >/dev/null || { echo "error: missing required package 'xdotool'"; exit 1; }
|
||||||
else
|
else
|
||||||
echo "error: invalid menu method (must be 'copy' or 'type')"
|
echo "error: invalid menu method (must be 'copy' or 'type')"
|
||||||
exit 1
|
exit 1
|
||||||
@ -128,7 +128,7 @@ elif [ "$#" = '2' ]; then
|
|||||||
elif [ "$1" = 'gen' ]; then
|
elif [ "$1" = 'gen' ]; then
|
||||||
generate $2
|
generate $2
|
||||||
elif [ "$1" = 'otp' ]; then
|
elif [ "$1" = 'otp' ]; then
|
||||||
[ ! $(command -v oathtool) ] && echo "error: missing required packaged 'oathtool'" && exit 1
|
command -v oathtool >/dev/null || { echo "error: missing required package 'oathtool'"; exit 1; }
|
||||||
otp $2
|
otp $2
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user