Created
March 28, 2021 09:47
-
-
Save karronoli/e345de6606bd8435540cc01e86e9a835 to your computer and use it in GitHub Desktop.
`PASSWORD_STORE_ENABLE_EXTENSIONS=true pass wsl show -c path/to/password` on WSL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clip() { | |
local sleep_argv0="password store sleep on display $DISPLAY" | |
pkill -f "^$sleep_argv0" 2>/dev/null && sleep 0.5 | |
echo -n "$1" | clip.exe || die "Error: Could not copy data to the clipboard" | |
( | |
( exec -a "$sleep_argv0" bash <<<"trap 'kill %1' TERM; sleep '$CLIP_TIME' & wait" ) | |
echo -n | clip.exe | |
) >/dev/null 2>&1 & disown | |
echo "Copied $2 to clipboard. Will clear in $CLIP_TIME seconds." | |
} | |
case "$1" in | |
init) shift; cmd_init "$@" ;; | |
help|--help) shift; cmd_usage "$@" ;; | |
version|--version) shift; cmd_version "$@" ;; | |
show|ls|list) shift; cmd_show "$@" ;; | |
find|search) shift; cmd_find "$@" ;; | |
grep) shift; cmd_grep "$@" ;; | |
insert|add) shift; cmd_insert "$@" ;; | |
edit) shift; cmd_edit "$@" ;; | |
generate) shift; cmd_generate "$@" ;; | |
delete|rm|remove) shift; cmd_delete "$@" ;; | |
rename|mv) shift; cmd_copy_move "move" "$@" ;; | |
copy|cp) shift; cmd_copy_move "copy" "$@" ;; | |
git) shift; cmd_git "$@" ;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment