add support for tmux clipboard
This commit is contained in:
parent
ed0cc25d27
commit
82a4fb1bad
14
pash
14
pash
@ -92,6 +92,16 @@ die() {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
copy() {
|
||||||
|
[[ $TMUX ]] && {
|
||||||
|
tmux load-buffer "$password"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
hash xclip 2>/dev/null &&
|
||||||
|
xclip -selection clipboard &>/dev/null <<< "$password"
|
||||||
|
}
|
||||||
|
|
||||||
usage() { printf '%s' "\
|
usage() { printf '%s' "\
|
||||||
pash - simple password manager.
|
pash - simple password manager.
|
||||||
usage: pash [add|del|show|list] [name] [-n,-q,-c] [-l length]
|
usage: pash [add|del|show|list] [name] [-n,-q,-c] [-l length]
|
||||||
@ -152,8 +162,8 @@ main() {
|
|||||||
*) usage ;;
|
*) usage ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
[[ $clipboard && $password ]] && hash xclip 2>/dev/null &&
|
[[ $clipboard && $password ]] &&
|
||||||
xclip -selection clipboard &>/dev/null <<< "$password"
|
copy
|
||||||
|
|
||||||
[[ -z $quiet && $password ]] &&
|
[[ -z $quiet && $password ]] &&
|
||||||
printf '%s\n' "$password"
|
printf '%s\n' "$password"
|
||||||
|
Loading…
Reference in New Issue
Block a user