Created
January 27, 2017 07:39
-
-
Save ChristopherA/31750863730f8363fe334ebdb5cf2b37 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
#!/usr/bin/env bash | |
# from https://github.com/westurner/dotfiles/tree/develop/scripts | |
### pbcopy | |
# Shim to support something like pbcopy on Linux | |
function pbcopy { | |
__IS_MAC=${__IS_MAC:-$(test "$(uname -s)" == "Darwin" && echo 'true')} | |
if [ -n "${__IS_MAC}" ]; then | |
cat | /usr/bin/pbcopy | |
exit | |
else | |
# copy to selection buffer AND clipboard | |
cat | xclip -i -sel c -f | xclip -i -sel p | |
exit | |
fi | |
} | |
if [ -n "${BASH_SOURCE}" ] && [ "$BASH_SOURCE" == "$0" ]; then | |
pbcopy | |
fi | |
#!/usr/bin/env bash | |
# Shim to support something like pbpaste on Linux | |
__IS_MAC=${__IS_MAC:-$(test $(uname -s) == "Darwin" && echo 'true')} | |
if [ -n "${__IS_MAC}" ]; then | |
/usr/bin/pbpaste ${@} | |
exit | |
else | |
xclip -selection clipboard -o | |
exit | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks :) Added to my dotfiles.