Last active
September 30, 2018 16:27
-
-
Save redxef/9ddf91413b82b2e97a5c0a8a0127f8c5 to your computer and use it in GitHub Desktop.
This file contains 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
# Copy this function into your ~/.bashrc file to make the clipboard work in the WSL. | |
# This is not beautiful or encouraged, but gets the job done. | |
pass() { | |
if [[ "$1" = '-c' ]] || [[ "$1" = '--clip' ]]; then | |
$(which pass) "$2" | head -n1 | clip.exe | |
[[ -f ~/.pass-clr-pid ]] && kill "$(cat ~/.pass-clr-pid)" | |
((sleep 45 && echo '' | clip.exe) && rm ~/.pass-clr-pid) & | |
local pid=$! | |
echo "$pid" > ~/.pass-clr-pid | |
else | |
$(which pass) "$@" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment