[img]url[/img]#!/bin/bash
# https://github.com/Ceryn/img
# Call with '-s' to target only a selection of the screen.
clientid='3e7a4deb7ac67da'
img=$(mktemp '/tmp/img-XXXXXX.png')
import $img >/dev/null 2>&1 || exit
res=$(curl -sH "Authorization: Client-ID $clientid" -F "image=@$img" "https://api.imgur.com/3/upload")
echo $res | grep -qo '"status":200' && link=$(echo $res | sed -e 's/.*"link":"\([^"]*\).*/\1/' -e 's/\\//g')
test -n "$link" && (printf "\a" && rm "$img") || echo "$res" > "$img.error"
echo $link >> ~/.imgur.log
xdg-open $link
sofar wrote:Here's the shell script I have, works on linux, and uses `ImageMagick`. I have it bound in my desktop environment to a keypress, so that in the game, I can make a keypress, and click the window I want to capture, and then it makes the screenshot, uploads it to imgur.com, and opens the URL in my browser so I can see the image and copy/paste the link somewhere nice and easily.Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
#!/bin/bash
# https://github.com/Ceryn/img
# Call with '-s' to target only a selection of the screen.
clientid='3e7a4deb7ac67da'
img=$(mktemp '/tmp/img-XXXXXX.png')
import $img >/dev/null 2>&1 || exit
res=$(curl -sH "Authorization: Client-ID $clientid" -F "image=@$img" "https://api.imgur.com/3/upload")
echo $res | grep -qo '"status":200' && link=$(echo $res | sed -e 's/.*"link":"\([^"]*\).*/\1/' -e 's/\\//g')
test -n "$link" && (printf "\a" && rm "$img") || echo "$res" > "$img.error"
echo $link >> ~/.imgur.log
xdg-open $link
[img]https://forum.minetest.net/download/file.php?mode=view&id=5038[/img] snowflake wrote:thx for the info mine
MineYoshi wrote:i think it's time snowflake put "[Solved]" in the title, except he don't understand everything or need more help about this...
UjEdwin wrote:MineYoshi wrote:i think it's time snowflake put "[Solved]" in the title, except he don't understand everything or need more help about this...
i thought it was pretty much steps, so i made another description that could be easier to read for other people :-)
everyone do not perceive all the information in the same way, and in this case it is a
tricky thing to see.
Users browsing this forum: No registered users and 12 guests