+# http://www.reddit.com/r/linux/comments/2cgu5k/a_handy_little_script_for_interacting_with_your/
+function clip () {
+ if [ -t 0 ] && [ -z "$1" ]; then
+ # output contents of clipboard
+ xclip -out -selection clipboard || exit 1
+ elif [ "$1" ]; then
+ # copy file contents to clipboard
+ xclip -in -selection clipboard < "$1" || exit 1
+ else
+ # copy stdin to clipboard
+ xclip -in -selection clipboard <&0 || exit 1
+ fi
+}
+