config/bin/screenie

19 lines
370 B
Plaintext
Raw Normal View History

2020-05-14 20:03:55 +02:00
#!/bin/bash
NAME="ss-$(cat /dev/urandom | tr -dc A-Za-z0-9 | head -c${1:-32};)"
2020-12-08 11:51:34 +01:00
maim -m 10 -s /tmp/$NAME.jpg -c 1,0.25,0.25,0.6 --hidecursor
if [ $? -ne 0 ]; then
2020-05-14 20:03:55 +02:00
exit
fi
2020-12-08 11:51:34 +01:00
if [ ! -e /tmp/$NAME.jpg ]; then
2020-05-14 20:03:55 +02:00
exit
fi
2020-12-08 11:51:34 +01:00
scp /tmp/$NAME.jpg ss:ss
if [ $? -eq 0 ]; then
echo -n 'https://ss.fuyu.moe/nisevoid/'$NAME'.jpg' | xclip -selection "clip-board"
2020-05-14 20:03:55 +02:00
fi
2020-12-08 11:51:34 +01:00
rm /tmp/$NAME.jpg