blob: 6f8027d9b0e2a57956a7d4936251e38796339de2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
|
#!/bin/bash
# Takes some text from stdin and use the pastebin service ix.io to
# generate a link. The link is then printed to stdout and automatically
# copied to the clipboard.
# N.B. `head -c-1` removes the trailing newline from the output of the
# `curl` command, because newlines in the clipboard are usually
# annoying.
cat - | curl -sF 'f:1=<-' ix.io | head -c-1 | xclip -f -i -selection clipboard && echo
|