Closed krompus closed 8 years ago
xclip -selection c
will likely put it in the clipboard that you are wanting
Overall, if I am correctly reading what you are trying to do, you could replace the last two lines with:
curl -F c=@$img https://ptpb.pw?u=1 | xclip -f -selection c
That should post $img, returning only the URL (due to the ?u=1 at the end), and then send that to xclip which should put it in your ^C/^V clipboard (might vary across systems), while passing the stdin back to stdout with the -f flag.
Edit: just saw you were doing notify-send, so I guess continue saving the results off to a variable so you can notify-send it.
Oh, well, that works!
Haha, I had already tried xclip -selection secondary
, but I guess I misread the manpage, as I thought that "secondary" was equivalent to "clipboard".
Thanks a bunch!
I currently use this script, bound to a keybind, to quickly upload and share scrots:
It works very well, and I highly recommend using it! I'm wondering if anyone could suggest a way to modify it to copy to the clipboard rather than primary selection; I keep losing the URL when I accidentally highlight things before pasting.