Skip to content

Instantly share code, notes, and snippets.

@imiric
Created August 31, 2017 18:59
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save imiric/4ddd7b669c2ac6642c53d7a4bff070e6 to your computer and use it in GitHub Desktop.
Save imiric/4ddd7b669c2ac6642c53d7a4bff070e6 to your computer and use it in GitHub Desktop.
xclip for Cygwin/MSYS2
#!/bin/bash
# This replicates xclip functionality used by pass in Cygwin/MSYS2
# Original author: https://tylor.io/2015/07/13/password-manager/
while [[ $# > 0 ]]
do
key="$1"
case $key in
-o|-out)
OUT=1
shift
;;
*)
shift
;;
esac
done
if [[ $OUT -eq 0 ]]; then
cat - > /dev/clipboard
else
cat /dev/clipboard
fi
@dtoebe
Copy link

dtoebe commented Mar 10, 2019

Thanks, this worked great!

@fschrofner
Copy link

Works like a charm!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment