Skip to content

Instantly share code, notes, and snippets.

@dtoebe
Forked from imiric/xclip
Created March 10, 2019 19:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dtoebe/74fb2479410e8567259b12f677e52710 to your computer and use it in GitHub Desktop.
Save dtoebe/74fb2479410e8567259b12f677e52710 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment